test_append_files() {
local workspace="${1:?}"
- local sd_initrd file dir
+ local exitrd file dir
- # Create a shutdown initrd
+ # Create an exitrd
#
- # This should provide coverage for shutdown initrd related issues, see:
+ # This should provide coverage for exitrd related issues, see:
# - https://github.com/systemd/systemd/issues/28645
# - https://github.com/systemd/systemd/pull/28648
# - https://github.com/systemd/systemd/pull/28793
# This is a bit messier than I originally anticipated, as installing our own libraries
# is handled implicitly by install_systemd() which I don't want to use here, since
# I need only the systemd-shutdown binary
- sd_initrd="$workspace/shutdown-initrd"
- mkdir -p "$sd_initrd/etc" "$sd_initrd/usr"
- initdir="$sd_initrd" image_install bash /usr/lib/os-release
- ln -srf "$sd_initrd/usr/lib/os-release" "$sd_initrd/etc/initrd-release"
- initdir="$sd_initrd" inst_binary "$workspace/usr/lib/systemd/systemd-shutdown" "/usr/lib/systemd/systemd-shutdown"
- initdir="$sd_initrd" inst_libs "$sd_initrd/usr/lib/systemd/systemd-shutdown"
+ exitrd="$workspace/exitrd"
+ mkdir -p "$exitrd/etc" "$exitrd/usr"
+ initdir="$exitrd" image_install bash /usr/lib/os-release
+ ln -srf "$exitrd/usr/lib/os-release" "$exitrd/etc/initrd-release"
+ initdir="$exitrd" inst_binary "$workspace/usr/lib/systemd/systemd-shutdown" "/usr/lib/systemd/systemd-shutdown"
+ initdir="$exitrd" inst_libs "$exitrd/usr/lib/systemd/systemd-shutdown"
# We need to deal with libsystemd stuff explicitly, as we don't call install_systemd() here
while read -r file; do
- initdir="$sd_initrd" inst_library "$file" "${file##"$workspace"}"
- initdir="$sd_initrd" inst_libs "$file"
+ initdir="$exitrd" inst_library "$file" "${file##"$workspace"}"
+ initdir="$exitrd" inst_libs "$file"
done < <(find "$workspace/usr/" -name "libsystemd*.so*")
# Call systemd-shutdown indirectly, so we can show a message that we can check for
- # later to make sure the shutdown initrd was actually executed
- cat >"$sd_initrd/shutdown" <<\EOF
+ # later to make sure the exitrd was actually executed
+ cat >"$exitrd/shutdown" <<\EOF
#!/usr/bin/bash -eu
-echo "Hello from shutdown initrd"
+echo "Hello from exitrd"
exec /usr/lib/systemd/systemd-shutdown "$@"
EOF
- chmod +x "$sd_initrd/shutdown"
+ chmod +x "$exitrd/shutdown"
}
check_result_qemu_hook() {