From 8fa4d8f7fd654bdce13d1dd40e9cf8f31de297d8 Mon Sep 17 00:00:00 2001 From: NOGISAKA Sadata Date: Sat, 26 Aug 2023 13:23:01 +0900 Subject: [PATCH] Support mkosi >= 15 - 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: https://github.com/systemd/mkosi/issues/1729 --- .gitignore | 1 + buildspawn/Makefile | 2 +- buildspawn/{mkosi.default => mkosi.conf} | 6 ++---- buildspawn/mkosi.postinst | 5 +++++ buildspawn/mkosi.repart/root.conf | 5 +++++ corespawn/Makefile | 2 +- corespawn/{mkosi.default => mkosi.conf} | 6 ++---- corespawn/mkosi.postinst | 5 +++++ corespawn/mkosi.repart/root.conf | 5 +++++ guispawn/Makefile | 2 +- guispawn/mkosi.build | 5 +++++ guispawn/{mkosi.default => mkosi.conf} | 7 ++----- guispawn/mkosi.postinst | 5 +++++ guispawn/mkosi.repart/root.conf | 5 +++++ mstdnspawn/Makefile | 2 +- mstdnspawn/{mkosi.default => mkosi.conf} | 6 ++---- mstdnspawn/mkosi.postinst | 5 +++++ mstdnspawn/mkosi.repart/root.conf | 5 +++++ sngskspawn/Makefile | 2 +- sngskspawn/{mkosi.default => mkosi.conf} | 6 ++---- sngskspawn/mkosi.postinst | 5 +++++ sngskspawn/mkosi.repart/root.conf | 5 +++++ tlspawn/Makefile | 2 +- tlspawn/{mkosi.default => mkosi.conf} | 5 +---- tlspawn/mkosi.postinst | 5 +++++ tlspawn/mkosi.repart/root.conf | 5 +++++ torspawn/Makefile | 2 +- torspawn/{mkosi.default => mkosi.conf} | 5 +---- torspawn/mkosi.postinst | 5 +++++ torspawn/mkosi.repart/root.conf | 5 +++++ 30 files changed, 95 insertions(+), 36 deletions(-) rename buildspawn/{mkosi.default => mkosi.conf} (83%) create mode 100644 buildspawn/mkosi.repart/root.conf rename corespawn/{mkosi.default => mkosi.conf} (81%) create mode 100644 corespawn/mkosi.repart/root.conf rename guispawn/{mkosi.default => mkosi.conf} (87%) create mode 100644 guispawn/mkosi.repart/root.conf rename mstdnspawn/{mkosi.default => mkosi.conf} (90%) create mode 100644 mstdnspawn/mkosi.repart/root.conf rename sngskspawn/{mkosi.default => mkosi.conf} (82%) create mode 100644 sngskspawn/mkosi.repart/root.conf rename tlspawn/{mkosi.default => mkosi.conf} (84%) create mode 100644 tlspawn/mkosi.repart/root.conf rename torspawn/{mkosi.default => mkosi.conf} (83%) create mode 100644 torspawn/mkosi.repart/root.conf diff --git a/.gitignore b/.gitignore index f920cb5..6df4f83 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ mkosi.cache/ mkosi.builddir/ *.cache-pre-dev *.cache-pre-inst +mkosi.extra/mirrorlist diff --git a/buildspawn/Makefile b/buildspawn/Makefile index 597840b..dfd96dd 100644 --- a/buildspawn/Makefile +++ b/buildspawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/buildspawn/mkosi.default b/buildspawn/mkosi.conf similarity index 83% rename from buildspawn/mkosi.default rename to buildspawn/mkosi.conf index 4d2e12b..429c445 100644 --- a/buildspawn/mkosi.default +++ b/buildspawn/mkosi.conf @@ -2,10 +2,11 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] Packages= + gzip aria2 base-devel ccache @@ -23,6 +24,3 @@ Packages= !systemd-sysvcompat !usbutils !util-linux - -[Partitions] -RootSize=3221225472 diff --git a/buildspawn/mkosi.postinst b/buildspawn/mkosi.postinst index 52e05e4..267e238 100755 --- a/buildspawn/mkosi.postinst +++ b/buildspawn/mkosi.postinst @@ -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 diff --git a/buildspawn/mkosi.repart/root.conf b/buildspawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/buildspawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/corespawn/Makefile b/corespawn/Makefile index 597840b..dfd96dd 100644 --- a/corespawn/Makefile +++ b/corespawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/corespawn/mkosi.default b/corespawn/mkosi.conf similarity index 81% rename from corespawn/mkosi.default rename to corespawn/mkosi.conf index d73ccbf..bca3b1e 100644 --- a/corespawn/mkosi.default +++ b/corespawn/mkosi.conf @@ -2,10 +2,11 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] Packages= + gzip pacman-contrib polkit reflector @@ -18,6 +19,3 @@ Packages= !systemd-sysvcompat !usbutils !util-linux - -[Partitions] -RootSize=2147483648 diff --git a/corespawn/mkosi.postinst b/corespawn/mkosi.postinst index ec376b1..9c78a68 100755 --- a/corespawn/mkosi.postinst +++ b/corespawn/mkosi.postinst @@ -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 diff --git a/corespawn/mkosi.repart/root.conf b/corespawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/corespawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/guispawn/Makefile b/guispawn/Makefile index ca82863..9bad9f3 100644 --- a/guispawn/Makefile +++ b/guispawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/guispawn/mkosi.build b/guispawn/mkosi.build index aee4483..d598164 100755 --- a/guispawn/mkosi.build +++ b/guispawn/mkosi.build @@ -1,5 +1,10 @@ #!/bin/bash +# shellcheck disable=SC2154 +if [ "$container" != "mkosi" ]; then + exec mkosi-chroot "$SCRIPT" "$@" +fi + BUILDER=builder useradd -m "${BUILDER}" diff --git a/guispawn/mkosi.default b/guispawn/mkosi.conf similarity index 87% rename from guispawn/mkosi.default rename to guispawn/mkosi.conf index 108a5f5..933e675 100644 --- a/guispawn/mkosi.default +++ b/guispawn/mkosi.conf @@ -2,11 +2,11 @@ Distribution=arch [Output] -Bootable=false -Format=raw_btrfs +Format=disk [Packages] Packages= + gzip chromium git grep @@ -36,6 +36,3 @@ BuildPackages= BuildSources=aurpkg SourceFileTransfer=mount WithNetwork=true - -[Partitions] -RootSize=4294967296 diff --git a/guispawn/mkosi.postinst b/guispawn/mkosi.postinst index aba0539..b7a7511 100755 --- a/guispawn/mkosi.postinst +++ b/guispawn/mkosi.postinst @@ -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 diff --git a/guispawn/mkosi.repart/root.conf b/guispawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/guispawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/mstdnspawn/Makefile b/mstdnspawn/Makefile index 597840b..dfd96dd 100644 --- a/mstdnspawn/Makefile +++ b/mstdnspawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/mstdnspawn/mkosi.default b/mstdnspawn/mkosi.conf similarity index 90% rename from mstdnspawn/mkosi.default rename to mstdnspawn/mkosi.conf index 330f84a..fcea829 100644 --- a/mstdnspawn/mkosi.default +++ b/mstdnspawn/mkosi.conf @@ -2,11 +2,12 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] WithNetwork=yes Packages= + gzip base-devel ffmpeg git @@ -43,6 +44,3 @@ Packages= !usbutils !util-linux !pciutils - -[Partitions] -RootSize=4294967296 diff --git a/mstdnspawn/mkosi.postinst b/mstdnspawn/mkosi.postinst index d76d39c..ac71fcd 100755 --- a/mstdnspawn/mkosi.postinst +++ b/mstdnspawn/mkosi.postinst @@ -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 diff --git a/mstdnspawn/mkosi.repart/root.conf b/mstdnspawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/mstdnspawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/sngskspawn/Makefile b/sngskspawn/Makefile index 597840b..dfd96dd 100644 --- a/sngskspawn/Makefile +++ b/sngskspawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/sngskspawn/mkosi.default b/sngskspawn/mkosi.conf similarity index 82% rename from sngskspawn/mkosi.default rename to sngskspawn/mkosi.conf index d0af6ce..904d783 100644 --- a/sngskspawn/mkosi.default +++ b/sngskspawn/mkosi.conf @@ -2,10 +2,11 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] Packages= + gzip git nginx pacman-contrib @@ -20,6 +21,3 @@ Packages= !usbutils !util-linux !pciutils - -[Partitions] -RootSize=2147483648 diff --git a/sngskspawn/mkosi.postinst b/sngskspawn/mkosi.postinst index 6b304c5..b5625ee 100755 --- a/sngskspawn/mkosi.postinst +++ b/sngskspawn/mkosi.postinst @@ -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 diff --git a/sngskspawn/mkosi.repart/root.conf b/sngskspawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/sngskspawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/tlspawn/Makefile b/tlspawn/Makefile index 597840b..dfd96dd 100644 --- a/tlspawn/Makefile +++ b/tlspawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/tlspawn/mkosi.default b/tlspawn/mkosi.conf similarity index 84% rename from tlspawn/mkosi.default rename to tlspawn/mkosi.conf index 2da07d7..461a5e9 100644 --- a/tlspawn/mkosi.default +++ b/tlspawn/mkosi.conf @@ -2,7 +2,7 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] Packages= @@ -23,6 +23,3 @@ Packages= !usbutils !util-linux !pciutils - -[Partitions] -RootSize=5368709120 diff --git a/tlspawn/mkosi.postinst b/tlspawn/mkosi.postinst index ec376b1..9c78a68 100755 --- a/tlspawn/mkosi.postinst +++ b/tlspawn/mkosi.postinst @@ -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 diff --git a/tlspawn/mkosi.repart/root.conf b/tlspawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/tlspawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess diff --git a/torspawn/Makefile b/torspawn/Makefile index 597840b..dfd96dd 100644 --- a/torspawn/Makefile +++ b/torspawn/Makefile @@ -1,5 +1,5 @@ CONTAINER = $(notdir $(shell pwd)) -MKOSI = mkosi.default \ +MKOSI = mkosi.conf \ mkosi.postinst \ mkosi.extra \ mkosi.nspawn diff --git a/torspawn/mkosi.default b/torspawn/mkosi.conf similarity index 83% rename from torspawn/mkosi.default rename to torspawn/mkosi.conf index f6bc83b..32818ce 100644 --- a/torspawn/mkosi.default +++ b/torspawn/mkosi.conf @@ -2,7 +2,7 @@ Distribution=arch [Output] -Format=raw_btrfs +Format=disk [Packages] Packages= @@ -22,6 +22,3 @@ Packages= !usbutils !util-linux !pciutils - -[Partitions] -RootSize=2147483648 diff --git a/torspawn/mkosi.postinst b/torspawn/mkosi.postinst index 6ef748a..4a20c55 100755 --- a/torspawn/mkosi.postinst +++ b/torspawn/mkosi.postinst @@ -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 diff --git a/torspawn/mkosi.repart/root.conf b/torspawn/mkosi.repart/root.conf new file mode 100644 index 0000000..b4a33e9 --- /dev/null +++ b/torspawn/mkosi.repart/root.conf @@ -0,0 +1,5 @@ +[Partition] +Type=root +Format=btrfs +CopyFiles=/ +Minimize=guess