Skip to content

Commit

Permalink
Support mkosi >= 15
Browse files Browse the repository at this point in the history
- Rename mkosi.default to mkosi.conf
- Add mkosi.repart to define root partition
- Add gzip to make sure generating locales
- Add snippet to mkosi.build / mkosi.postinst
  - See: systemd/mkosi#1729
  • Loading branch information
nosada committed Aug 26, 2023
1 parent e1fc619 commit 8fa4d8f
Show file tree
Hide file tree
Showing 30 changed files with 95 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mkosi.cache/
mkosi.builddir/
*.cache-pre-dev
*.cache-pre-inst
mkosi.extra/mirrorlist
2 changes: 1 addition & 1 deletion buildspawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
6 changes: 2 additions & 4 deletions buildspawn/mkosi.default → buildspawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
Packages=
gzip
aria2
base-devel
ccache
Expand All @@ -23,6 +24,3 @@ Packages=
!systemd-sysvcompat
!usbutils
!util-linux

[Partitions]
RootSize=3221225472
5 changes: 5 additions & 0 deletions buildspawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions buildspawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion corespawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
6 changes: 2 additions & 4 deletions corespawn/mkosi.default → corespawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
Packages=
gzip
pacman-contrib
polkit
reflector
Expand All @@ -18,6 +19,3 @@ Packages=
!systemd-sysvcompat
!usbutils
!util-linux

[Partitions]
RootSize=2147483648
5 changes: 5 additions & 0 deletions corespawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions corespawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion guispawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
5 changes: 5 additions & 0 deletions guispawn/mkosi.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

BUILDER=builder
useradd -m "${BUILDER}"

Expand Down
7 changes: 2 additions & 5 deletions guispawn/mkosi.default → guispawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Distribution=arch

[Output]
Bootable=false
Format=raw_btrfs
Format=disk

[Packages]
Packages=
gzip
chromium
git
grep
Expand Down Expand Up @@ -36,6 +36,3 @@ BuildPackages=
BuildSources=aurpkg
SourceFileTransfer=mount
WithNetwork=true

[Partitions]
RootSize=4294967296
5 changes: 5 additions & 0 deletions guispawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions guispawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion mstdnspawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
6 changes: 2 additions & 4 deletions mstdnspawn/mkosi.default → mstdnspawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
WithNetwork=yes
Packages=
gzip
base-devel
ffmpeg
git
Expand Down Expand Up @@ -43,6 +44,3 @@ Packages=
!usbutils
!util-linux
!pciutils

[Partitions]
RootSize=4294967296
5 changes: 5 additions & 0 deletions mstdnspawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions mstdnspawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion sngskspawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
6 changes: 2 additions & 4 deletions sngskspawn/mkosi.default → sngskspawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
Packages=
gzip
git
nginx
pacman-contrib
Expand All @@ -20,6 +21,3 @@ Packages=
!usbutils
!util-linux
!pciutils

[Partitions]
RootSize=2147483648
5 changes: 5 additions & 0 deletions sngskspawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions sngskspawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion tlspawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
5 changes: 1 addition & 4 deletions tlspawn/mkosi.default → tlspawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
Packages=
Expand All @@ -23,6 +23,3 @@ Packages=
!usbutils
!util-linux
!pciutils

[Partitions]
RootSize=5368709120
5 changes: 5 additions & 0 deletions tlspawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions tlspawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess
2 changes: 1 addition & 1 deletion torspawn/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTAINER = $(notdir $(shell pwd))
MKOSI = mkosi.default \
MKOSI = mkosi.conf \
mkosi.postinst \
mkosi.extra \
mkosi.nspawn
Expand Down
5 changes: 1 addition & 4 deletions torspawn/mkosi.default → torspawn/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Distribution=arch

[Output]
Format=raw_btrfs
Format=disk

[Packages]
Packages=
Expand All @@ -22,6 +22,3 @@ Packages=
!usbutils
!util-linux
!pciutils

[Partitions]
RootSize=2147483648
5 changes: 5 additions & 0 deletions torspawn/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# shellcheck disable=SC2154
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi

# Install required config
mv -f /locale.gen /etc/locale.gen
mv -f /locale.conf /etc/locale.conf
Expand Down
5 changes: 5 additions & 0 deletions torspawn/mkosi.repart/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Partition]
Type=root
Format=btrfs
CopyFiles=/
Minimize=guess

0 comments on commit 8fa4d8f

Please sign in to comment.