--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Config]
+ConfigureScripts=
+
+[Output]
+Format=directory
+
+[Content]
+Bootable=no
+@Locale=C.UTF-8
+WithDocs=no
+CleanPackageMetadata=yes
+MakeInitrd=yes
+
+BuildSources=
+Packages=
+BuildPackages=
+VolatilePackages=
+
+Packages=
+ bash
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+ systemd
+
+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/libasan.so*
+ /usr/lib/libtsan.so*
+ /usr/lib/liblsan.so*
+ /usr/lib/libubsan.so*
+ /usr/lib/libstdc++.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/*
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|fedora
+
+[Content]
+Packages=
+ systemd-standalone-shutdown
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|ubuntu
+
+[Content]
+Packages=
+ systemd
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+ systemd
--- /dev/null
+#!/usr/bin/bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -eux
+
+EXIT_CODE=()
+
+# Translate a successful exit code to 124 so that we can detect that the exitrd was actually used.
+if [[ "$*" == *"--exit-code=123"* ]]; then
+ EXIT_CODE+=("--exit-code=124")
+fi
+
+exec /usr/lib/systemd/systemd-shutdown "$@" "${EXIT_CODE[@]}"
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Unit]
+Description=Create a mount in /run that should survive the transition from initrd
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=mkdir /run/initrd-mount-source /run/initrd-mount-target
+ExecStart=mount -v --bind /run/initrd-mount-source /run/initrd-mount-target
+ExecStart=cp -v /etc/initrd-release /run/initrd-mount-target/hello-world
[Config]
Dependencies=
+ exitrd
minimal-base
minimal-0
minimal-1
%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
Packages=
acl
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
- 'enabled' : false,
+ 'cmdline' : integration_test_template['cmdline'] + [
+ 'rd.systemd.wants=initrd-run-mount.service',
+ ],
+ 'exit-code' : 124,
},
]
parser.add_argument('--storage', required=True)
parser.add_argument('--firmware', required=True)
parser.add_argument('--slow', action=argparse.BooleanOptionalAction)
+ parser.add_argument('--exit-code', required=True, type=int)
parser.add_argument('mkosi_args', nargs="*")
args = parser.parse_args()
result = subprocess.run(cmd)
- # Return code 123 is the expected success code
- if result.returncode in (123, 77):
+ if result.returncode in (args.exit_code, 77):
# Do not keep journal files for tests that don't fail.
if journal_file:
journal_file.unlink(missing_ok=True)
- exit(0 if result.returncode == 123 else 77)
+ exit(0 if result.returncode == args.exit_code else 77)
if journal_file:
ops = []
'cmdline' : [],
'credentials' : [],
'qemu-args' : [],
+ 'exit-code' : 123,
}
testdata_subdirs = [
'auxv',
'--name', integration_test['name'],
'--storage', integration_test['storage'],
'--firmware', integration_test['firmware'],
+ '--exit-code', integration_test['exit-code'].to_string(),
]
if 'unit' in integration_test