Skip to content

Commit

Permalink
test(FULL-SYSTEMD): fail if mkinitcpio installs more services that dr…
Browse files Browse the repository at this point in the history
…acut
  • Loading branch information
jozzsi authored and LaszloGombos committed Nov 10, 2024
1 parent 3a04a13 commit 6cf7b9e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/TEST-41-FULL-SYSTEMD/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,22 @@ EOF

grep -F -a -m 1 ID_FS_UUID "$TESTDIR"/marker.img > "$TESTDIR"/luks.uuid

# TODO enable systemd-bsod for Gentoo

test_dracut \
-m "systemd-battery-check resume dracut-systemd systemd-ac-power systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pcrphase systemd-pstore systemd-repart systemd-sysext systemd-veritysetup" \
-m "resume dracut-systemd systemd-ac-power systemd-battery-check systemd-bsod systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pcrphase systemd-pstore systemd-repart systemd-sysext systemd-veritysetup" \
--add-drivers "btrfs" \
"$TESTDIR"/initramfs.testing

if command -v mkinitcpio &> /dev/null; then
find "$TESTDIR"/initrd/dracut.*/initramfs/usr/lib/systemd/system/ -printf "%f\n" | sort | uniq > systemd-dracut
mkinitcpio -k "$KVERSION" --builddir "$TESTDIR" --save -A systemd
find "$TESTDIR"/mkinitcpio.*/root/usr/lib/systemd/system/ -printf "%f\n" | sort | uniq > systemd-mkinitcpio
echo "systemd units included in initrd from mkinitcpio but not from dracut"
diff systemd-dracut systemd-mkinitcpio | grep '> ' || :

# fail the test if mkinitcpio installs some services that dracut does not
mkinitcpio_units=$(comm -23 systemd-mkinitcpio systemd-dracut)
if [ -n "$mkinitcpio_units" ]; then
printf "\n *** systemd units included in initrd from mkinitcpio but not from dracut:%s\n\n" "${mkinitcpio_units}"
exit 1
fi
fi
}

Expand Down

0 comments on commit 6cf7b9e

Please sign in to comment.