]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Use initrd as exitrd main
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 19 Dec 2025 14:47:01 +0000 (15:47 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 21 Dec 2025 19:31:24 +0000 (20:31 +0100)
Let's speed up image builds by avoiding building
an exitrd and instead reusing the initrd image for
the same purpose.

mkosi/mkosi.conf
mkosi/mkosi.images/exitrd/mkosi.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/arch.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/build.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/centos-fedora.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/debian.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/opensuse.conf [deleted file]
mkosi/mkosi.images/exitrd/mkosi.conf.d/ubuntu.conf [deleted file]
mkosi/mkosi.images/initrd/mkosi.extra/shutdown [moved from mkosi/mkosi.images/exitrd/mkosi.extra/shutdown with 100% similarity]
test/units/TEST-08-INITRD.sh

index 28577b348f1ff8631bd4ecfde1be877b7d6c4040..1afc0de65c87f86534306fe60d6eb1ff4c9302fe 100644 (file)
@@ -3,7 +3,6 @@
 [Config]
 MinimumVersion=commit:9e31235211d975bae25622d6205a8396d104335e
 Dependencies=
-        exitrd
         initrd
         minimal-base
         minimal-0
@@ -57,7 +56,7 @@ ExtraTrees=
         %O/minimal-1.root-%a-verity.raw:/usr/share/minimal_1.verity
         %O/minimal-1.root-%a-verity-sig.raw:/usr/share/minimal_1.verity.sig
         %O/minimal-base:/usr/share/TEST-13-NSPAWN-container-template
-        %O/exitrd:/exitrd
+        %O/initrd:/exitrd
 
 Initrds=%O/initrd
 KernelInitrdModules=default
@@ -94,6 +93,7 @@ Packages=
         bash-completion
         binutils
         coreutils
+        cpio
         curl
         diffutils
         dnsmasq
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf b/mkosi/mkosi.images/exitrd/mkosi.conf
deleted file mode 100644 (file)
index 4a811e1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Output]
-Format=directory
-
-[Build]
-Environment=SYSTEMD_REQUIRED_DEPS_ONLY=1
-
-[Content]
-Bootable=no
-Locale=C.UTF-8
-WithDocs=no
-CleanPackageMetadata=yes
-MakeInitrd=yes
-
-Packages=
-        coreutils
-        bash
-
-[Include]
-Include=%D/mkosi/mkosi.sanitizers
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf.d/arch.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/arch.conf
deleted file mode 100644 (file)
index 9940b1e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=arch
-
-[Content]
-PrepareScripts=%D/mkosi/mkosi.conf.d/arch/systemd.prepare
-VolatilePackages=
-        systemd
-        systemd-libs
-
-RemoveFiles=
-        # Arch Linux doesn't split their gcc-libs package so we manually remove
-        # unneeded stuff here to make sure it doesn't end up in the image.
-        /usr/lib/libgfortran.so*
-        /usr/lib/libgo.so*
-        /usr/lib/libgomp.so*
-        /usr/lib/libgphobos.so*
-        /usr/lib/libobjc.so*
-        /usr/lib/libgdruntime.so*
-
-        # Remove all files that are only required for development.
-        /usr/lib/*.a
-        /usr/include/*
-
-        /usr/share/i18n/*
-        /usr/share/hwdata/*
-        /usr/share/iana-etc/*
-        /usr/share/locale/*
-        /usr/share/terminfo/*
-        /usr/share/zoneinfo/*
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf.d/build.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/build.conf
deleted file mode 100644 (file)
index 8c16d9b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# 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/mkosi.images/exitrd/mkosi.conf.d/centos-fedora.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/centos-fedora.conf
deleted file mode 100644 (file)
index 67fc047..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=|centos
-Distribution=|fedora
-
-[Content]
-PrepareScripts=%D/mkosi/mkosi.conf.d/centos-fedora/systemd.prepare
-VolatilePackages=
-        systemd-standalone-shutdown
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf.d/debian.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/debian.conf
deleted file mode 100644 (file)
index bce9491..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=debian
-
-[Content]
-PrepareScripts=%D/mkosi/mkosi.conf.d/debian-ubuntu/systemd.prepare
-VolatilePackages=
-        systemd-standalone-shutdown
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf.d/opensuse.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/opensuse.conf
deleted file mode 100644 (file)
index 5afda7a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=opensuse
-
-[Content]
-PrepareScripts=%D/mkosi/mkosi.conf.d/opensuse/systemd.prepare
-Packages=
-        diffutils
-        grep
-        patterns-base-minimal_base
-        sed
-        xz
-
-VolatilePackages=
-        libsystemd0
-        libudev1
-        systemd
diff --git a/mkosi/mkosi.images/exitrd/mkosi.conf.d/ubuntu.conf b/mkosi/mkosi.images/exitrd/mkosi.conf.d/ubuntu.conf
deleted file mode 100644 (file)
index f1ef2eb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=ubuntu
-
-[Content]
-PrepareScripts=%D/mkosi/mkosi.conf.d/debian-ubuntu/systemd.prepare
-VolatilePackages=
-        libsystemd-shared
-        libsystemd0
-        libudev1
-        systemd
index 48045272f8749def679f4ef2e575e75f4f6076e3..b59a5b99ffe63b8807a4e8a2a76ebd19ed19e7f5 100755 (executable)
@@ -22,9 +22,8 @@ test -d /run/initrd-mount-target
 mountpoint /run/initrd-mount-target
 [[ -e /run/initrd-mount-target/hello-world ]]
 
-# Copy the prepared exitrd to its intended location. Check the respective
-# test.sh file for details
+# Copy the prepared exitrd to its intended location.
 mkdir -p /run/initramfs
-cp -r /exitrd/* /run/initramfs/
+unzstd --stdout /exitrd | cpio --extract --make-directories --directory /run/initramfs/
 
 touch /testok