diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-07-16 12:07:38 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-07-16 13:59:47 +0200 |
commit | 68ee9771145464949d36d62a0ec687ecfb39290a (patch) | |
tree | 3be069837c9202c134100bf1bee43253797b2323 | |
parent | mkosi: Drop CacheOnly=always from two subimages (diff) | |
download | systemd-68ee9771145464949d36d62a0ec687ecfb39290a.tar.xz systemd-68ee9771145464949d36d62a0ec687ecfb39290a.zip |
mkosi: Build initrd as a subimage
Let's make things a little more consistent and build the initrd
explicitly as a subimage as well instead of relying on mkosi building
it as part of the main image build.
We drop the opensuse initrd postinst script as we don't use erofs by
default anymore. We can always reintroduce it again later if needed.
19 files changed, 94 insertions, 64 deletions
diff --git a/mkosi.conf b/mkosi.conf index cafd563c35..86ee19e1fc 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -2,9 +2,9 @@ [Config] MinimumVersion=23~devel -InitrdInclude=mkosi.initrd/ Dependencies= exitrd + initrd minimal-base minimal-0 minimal-1 @@ -45,6 +45,8 @@ ExtraTrees= %O/minimal-base:/usr/share/TEST-13-NSPAWN-container-template %O/exitrd:/exitrd +Initrds=%O/initrd + Environment= SYSTEMD_REPART_OVERRIDE_FSTYPE_ROOT=%F @@ -83,11 +85,6 @@ KernelCommandLine=systemd.crash_shell KernelModulesInitrdExclude=.* KernelModulesInitrdInclude=default -InitrdPackages= - findutils - grep - sed - Packages= acl attr diff --git a/mkosi.conf.d/10-arch/mkosi.conf b/mkosi.conf.d/10-arch/mkosi.conf index 7b719ff7b0..5a4015e4d7 100644 --- a/mkosi.conf.d/10-arch/mkosi.conf +++ b/mkosi.conf.d/10-arch/mkosi.conf @@ -52,12 +52,3 @@ Packages= tgt tpm2-tools vim - -InitrdPackages= - btrfs-progs - tpm2-tools - -InitrdVolatilePackages= - systemd - systemd-libs - systemd-sysvcompat diff --git a/mkosi.conf.d/10-centos-fedora/mkosi.conf b/mkosi.conf.d/10-centos-fedora/mkosi.conf index 8882c89b1b..6083fe4f07 100644 --- a/mkosi.conf.d/10-centos-fedora/mkosi.conf +++ b/mkosi.conf.d/10-centos-fedora/mkosi.conf @@ -59,10 +59,3 @@ Packages= util-linux veritysetup vim-common - -InitrdPackages= - tpm2-tools - -InitrdVolatilePackages= - systemd - systemd-udev diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index d282b47fb6..43e078117f 100644 --- a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -75,13 +75,3 @@ Packages= tpm2-tools tzdata xxd - -InitrdPackages= - btrfs-progs - tpm2-tools - -InitrdVolatilePackages= - systemd - systemd-cryptsetup - systemd-repart - udev diff --git a/mkosi.conf.d/10-fedora/mkosi.conf b/mkosi.conf.d/10-fedora/mkosi.conf index 92f0c7e9b0..adb7779a1e 100644 --- a/mkosi.conf.d/10-fedora/mkosi.conf +++ b/mkosi.conf.d/10-fedora/mkosi.conf @@ -23,6 +23,3 @@ Packages= rpmautospec sbsigntools scsi-target-utils - -InitrdPackages= - btrfs-progs diff --git a/mkosi.conf.d/10-opensuse/initrd/mkosi.postinst b/mkosi.conf.d/10-opensuse/initrd/mkosi.postinst deleted file mode 100755 index 417132f3dd..0000000000 --- a/mkosi.conf.d/10-opensuse/initrd/mkosi.postinst +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -# OpenSUSE insists on blacklisting erofs by default because its supposedly a legacy filesystem. -# See https://github.com/openSUSE/suse-module-tools/pull/71 -rm -f "$BUILDROOT/usr/lib/modprobe.d/60-blacklist_fs-erofs.conf" diff --git a/mkosi.conf.d/10-opensuse/mkosi.conf b/mkosi.conf.d/10-opensuse/mkosi.conf index 2a6bd6e7bf..e741aa4a9c 100644 --- a/mkosi.conf.d/10-opensuse/mkosi.conf +++ b/mkosi.conf.d/10-opensuse/mkosi.conf @@ -3,9 +3,6 @@ [Match] Distribution=opensuse -[Config] -InitrdInclude=initrd/ - [Distribution] Release=tumbleweed Repositories=non-oss @@ -80,13 +77,3 @@ Packages= vim xz zypper - -InitrdPackages= - btrfs-progs - kmod - tpm2.0-tools - -InitrdVolatilePackages= - systemd - udev - systemd-experimental diff --git a/mkosi.images/initrd/mkosi.conf b/mkosi.images/initrd/mkosi.conf new file mode 100644 index 0000000000..ab5be9b884 --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Config] +Include= + mkosi-initrd + %D/mkosi.sanitizers + +[Content] +ExtraTrees= + %D/mkosi.leak-sanitizer-suppressions:/usr/lib/systemd/leak-sanitizer-suppressions + %D/mkosi.coredump-journal-storage.conf:/usr/lib/systemd/coredump.conf.d/10-coredump-journal-storage.conf + +Packages= + findutils + grep + sed diff --git a/mkosi.images/initrd/mkosi.conf.d/arch.conf b/mkosi.images/initrd/mkosi.conf.d/arch.conf new file mode 100644 index 0000000000..99e039d1dc --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/arch.conf @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Distribution=arch + +[Content] +Packages= + btrfs-progs + tpm2-tools + +VolatilePackages= + systemd + systemd-libs + systemd-sysvcompat diff --git a/mkosi.images/initrd/mkosi.conf.d/build.conf b/mkosi.images/initrd/mkosi.conf.d/build.conf new file mode 100644 index 0000000000..8c16d9b9f8 --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/build.conf @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +# Add a dependency on the build image unless NO_BUILD=1. + +[Match] +Environment=!NO_BUILD=1 + +[Config] +Dependencies=build diff --git a/mkosi.images/initrd/mkosi.conf.d/centos-fedora.conf b/mkosi.images/initrd/mkosi.conf.d/centos-fedora.conf new file mode 100644 index 0000000000..811d35266b --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/centos-fedora.conf @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Distribution=|centos +Distribution=|fedora + +[Content] +Packages= + tpm2-tools + +VolatilePackages= + systemd + systemd-udev diff --git a/mkosi.images/initrd/mkosi.conf.d/debian-ubuntu.conf b/mkosi.images/initrd/mkosi.conf.d/debian-ubuntu.conf new file mode 100644 index 0000000000..8d56ff206b --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/debian-ubuntu.conf @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Distribution=|debian +Distribution=|ubuntu + +[Content] +Packages= + btrfs-progs + tpm2-tools + +VolatilePackages= + systemd + systemd-cryptsetup + systemd-repart + udev diff --git a/mkosi.images/initrd/mkosi.conf.d/fedora.conf b/mkosi.images/initrd/mkosi.conf.d/fedora.conf new file mode 100644 index 0000000000..634b5a0f41 --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/fedora.conf @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Distribution=fedora + +[Content] +Packages= + btrfs-progs diff --git a/mkosi.images/initrd/mkosi.conf.d/opensuse.conf b/mkosi.images/initrd/mkosi.conf.d/opensuse.conf new file mode 100644 index 0000000000..e04f8bcd11 --- /dev/null +++ b/mkosi.images/initrd/mkosi.conf.d/opensuse.conf @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Distribution=opensuse + +[Content] +Packages= + btrfs-progs + kmod + tpm2.0-tools + +VolatilePackages= + systemd + udev + systemd-experimental diff --git a/mkosi.initrd/mkosi.extra/usr/lib/encrypted-var.repart.d/00-root.conf b/mkosi.images/initrd/mkosi.extra/usr/lib/encrypted-var.repart.d/00-root.conf index b252491826..b252491826 100644 --- a/mkosi.initrd/mkosi.extra/usr/lib/encrypted-var.repart.d/00-root.conf +++ b/mkosi.images/initrd/mkosi.extra/usr/lib/encrypted-var.repart.d/00-root.conf diff --git a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/encrypted-var.service b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/encrypted-var.service index 54a9b8aa9e..54a9b8aa9e 100644 --- a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/encrypted-var.service +++ b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/encrypted-var.service diff --git a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/initrd-run-mount.service b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/initrd-run-mount.service index 845ac57455..845ac57455 100644 --- a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/initrd-run-mount.service +++ b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/initrd-run-mount.service diff --git a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/initrdcred.service b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/initrdcred.service index 2c709bccc4..2c709bccc4 100644 --- a/mkosi.initrd/mkosi.extra/usr/lib/systemd/system/initrdcred.service +++ b/mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/initrdcred.service diff --git a/mkosi.initrd/mkosi.conf b/mkosi.initrd/mkosi.conf deleted file mode 100644 index baf08726c0..0000000000 --- a/mkosi.initrd/mkosi.conf +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Content] -ExtraTrees= - ../mkosi.leak-sanitizer-suppressions:/usr/lib/systemd/leak-sanitizer-suppressions - ../mkosi.coredump-journal-storage.conf:/usr/lib/systemd/coredump.conf.d/10-coredump-journal-storage.conf - -[Config] -Include=../mkosi.sanitizers |