- changed-files:
- any-glob-to-any-file: 'modules.d/[0-9][0-9]systemd-veritysetup/*'
+systemd-emergency:
+ - changed-files:
+ - any-glob-to-any-file: 'modules.d/[0-9][0-9]systemd-emergency/*'
+
caps:
- changed-files:
- any-glob-to-any-file: 'modules.d/[0-9][0-9]caps/*'
--- /dev/null
+#!/bin/bash
+# This file is part of dracut.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+check() {
+ require_binaries "$systemdutildir"/systemd-sulogin-shell || return 1
+
+ return 255
+}
+
+depends() {
+ echo systemd
+}
+
+install() {
+ inst_multiple -o \
+ "$systemdsystemunitdir"/emergency.target \
+ "$systemdsystemunitdir"/emergency.service \
+ "$systemdsystemunitdir"/rescue.target \
+ "$systemdsystemunitdir"/rescue.service \
+ "$systemdutildir"/systemd-sulogin-shell
+}
optional_modules="$optional_modules systemd-pcrphase"
fi
test_dracut \
- -a "resume dracut-systemd systemd-ac-power systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pstore systemd-repart systemd-sysext systemd-veritysetup $optional_modules" \
+ -a "resume dracut-systemd systemd-emergency systemd-ac-power systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pstore systemd-repart systemd-sysext systemd-veritysetup $optional_modules" \
--add-drivers "btrfs" \
"$TESTDIR"/initramfs.testing
printf "\n *** systemd units included in initrd from mkinitcpio but not from dracut:%s\n\n" "${mkinitcpio_units}"
exit 1
fi
+
+ # verify that in this configuration, dracut does not modify any native systemd service files and ensures compatibility with mkinitcpio
+ (cd "$TESTDIR"/mkinitcpio.*/root/usr/lib/systemd/system/ && find . -type f > /tmp/systemd-mkinitcpio)
+
+ while read -r unit; do
+ if ! diff -q "$TESTDIR"/mkinitcpio.*/root/usr/lib/systemd/system/"$unit" "$TESTDIR"/initrd/dracut.*/initramfs/usr/lib/systemd/system/"$unit"; then
+ exit 1
+ fi
+ done < /tmp/systemd-mkinitcpio
+
fi
}