]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(systemd): include dmi-sysfs
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 6 Oct 2024 23:43:16 +0000 (19:43 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 26 Oct 2024 12:53:38 +0000 (08:53 -0400)
See https://github.com/systemd/systemd/blob/main/src/core/kmod-setup.c#L145

Improve test case to make sure it is tested.

modules.d/00systemd/module-setup.sh
test/TEST-41-FULL-SYSTEMD/test.sh

index 761f698158737777fcbf2e06f546e7cdd4631f2f..c5812d6ac7d00378e206aff099613baa5a7cf88e 100755 (executable)
@@ -15,7 +15,7 @@ check() {
 }
 
 installkernel() {
-    hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256
+    hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256 dmi-sysfs
     instmods -s efivarfs
 }
 
index c2bff2882766a4a6dfecc4295a38772741f4f0c7..2b7737735b64745097b439b6074ef166f99322ce 100755 (executable)
@@ -27,6 +27,7 @@ client_run() {
     test_marker_reset
     "$testdir"/run-qemu \
         "${disk_args[@]}" \
+        -smbios type=11,value=io.systemd.credential:key=test \
         -append "$TEST_KERNEL_CMDLINE systemd.unit=testsuite.target systemd.mask=systemd-firstboot systemd.mask=systemd-vconsole-setup root=LABEL=dracut mount.usr=LABEL=dracutusr mount.usrfstype=btrfs mount.usrflags=subvol=usr,ro $client_opts $DEBUGOUT" \
         -initrd "$TESTDIR"/initramfs.testing || return 1
 
@@ -50,8 +51,8 @@ test_run() {
     . "$TESTDIR"/luks.uuid
 
     # luks
-    client_run "encrypted root with rd.luks.uuid" "root=LABEL=dracut_crypt rd.luks.uuid=$ID_FS_UUID rd.luks.key=/etc/key" || return 1
-    client_run "encrypted root with rd.luks.name" "root=/dev/mapper/crypt rd.luks.name=$ID_FS_UUID=crypt rd.luks.key=/etc/key" || return 1
+    client_run "encrypted root with rd.luks.uuid" "root=LABEL=dracut_crypt rd.luks.uuid=$ID_FS_UUID rd.luks.key=/run/credentials/@system/key" || return 1
+    client_run "encrypted root with rd.luks.name" "root=/dev/mapper/crypt rd.luks.name=$ID_FS_UUID=crypt rd.luks.key=/run/credentials/@system/key" || return 1
     return 0
 }
 
@@ -125,12 +126,10 @@ EOF
     test_marker_check dracut-root-block-created || return 1
 
     grep -F -a -m 1 ID_FS_UUID "$TESTDIR"/marker.img > "$TESTDIR"/luks.uuid
-    echo -n test > /tmp/key
 
     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" \
         --add-drivers "btrfs" \
-        -i "/tmp/key" "/etc/key" \
         "$TESTDIR"/initramfs.testing
 }