]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test(FULL-SYSTEMD): add test coverage for mkinitcpio
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 9 Nov 2024 14:20:54 +0000 (09:20 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 9 Nov 2024 20:49:15 +0000 (15:49 -0500)
Print systemd units included in initrd from mkinitcpio but not from dracut.

test/TEST-41-FULL-SYSTEMD/test.sh
test/container/Dockerfile-arch

index 0eb8071e030e0a358f9a3c46fed832ca8a431274..f7daebbd50725e903e7d32e06ebaee1c0c52f33d 100755 (executable)
@@ -132,10 +132,20 @@ EOF
 
     grep -F -a -m 1 ID_FS_UUID "$TESTDIR"/marker.img > "$TESTDIR"/luks.uuid
 
+    # TODO enable systemd-bsod for Gentoo
+
     test_dracut \
-        -m "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-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 '> ' || :
+    fi
 }
 
 # shellcheck disable=SC1090
index 4da74787476b4083771c867a49dbc7d4dd089f2a..f597666c48d558b806304254fc6995e9a905253b 100644 (file)
@@ -35,6 +35,7 @@ RUN pacman --noconfirm -Syu \
     lvm2 \
     make \
     mdadm \
+    mkinitcpio \
     mkosi \
     multipath-tools \
     nbd \