%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/initrd:/exitrd
KernelInitrdModules=default
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Unit]
+Description=Copy initrd contents to /run/initramfs to serve as exitrd
+DefaultDependencies=no
+AssertPathExists=/etc/initrd-release
+After=initrd.target
+Before=initrd-cleanup.service initrd-switch-root.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=mkdir -p /run/initramfs
+ExecStart=cp -a --one-file-system /. /run/initramfs/
'name' : fs.name(meson.current_source_dir()),
'cmdline' : integration_test_template['cmdline'] + [
'rd.systemd.wants=initrd-run-mount.service',
+ 'rd.systemd.wants=initrd-run-initramfs.service',
],
'exit-code' : 124,
'vm' : true,
mountpoint /run/initrd-mount-target
[[ -e /run/initrd-mount-target/hello-world ]]
-# Copy the prepared exitrd to its intended location.
-mkdir -p /run/initramfs
-unzstd --stdout /exitrd | cpio --extract --make-directories --directory /run/initramfs/
+# The initrd-run-initramfs.service in the initrd should have populated /run/initramfs
+# from the initrd's own contents before switch-root.
+test -x /run/initramfs/shutdown
touch /testok