]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: add --pbkdf pbkdf2 to luksFormat commands
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 28 Jun 2025 16:33:16 +0000 (12:33 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 28 Jun 2025 19:41:14 +0000 (15:41 -0400)
Make the test work with recent release (v2.8.0) of cryptsetup.

This PR keeps memory requirements for LUKS unlocking minimal,
allowing testcases run in system with minimal memory.

The storage stack and boot process that is being tested,
remains exactly the same.

Default for LUKS2 is now Argon2 (memory-hard KDF,
so it means that it requires some amount of memory).

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1389
test/TEST-20-STORAGE/create-root.sh
test/TEST-26-ENC-RAID-LVM/create-root.sh
test/TEST-41-FULL-SYSTEMD/create-root.sh
test/TEST-72-NBD/create-encrypted-root.sh

index de2b070f512aad8bfe63977fd6b8a26d1496f8d6..7d92edf18edb5250c067ae8f2ab3f73d4c169daa 100755 (executable)
@@ -24,7 +24,7 @@ else
 
     if ! grep -qF 'rd.luks=0' /proc/cmdline && command -v cryptsetup > /dev/null; then
         printf test > keyfile
-        cryptsetup -q luksFormat /dev/md0 /keyfile
+        cryptsetup --pbkdf pbkdf2 -q luksFormat /dev/md0 /keyfile
         echo "The passphrase is test"
         cryptsetup luksOpen /dev/md0 dracut_crypt_test < /keyfile
         lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test
index cca1cd4aaf92ebef4b099cb3a4486a6ae87930fc..f0641fa43dafacd91b6a5fd934fd71ba191a0326 100755 (executable)
@@ -3,8 +3,8 @@
 trap 'poweroff -f' EXIT
 set -ex
 printf test > keyfile
-cryptsetup -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk1 /keyfile
-cryptsetup -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk2 /keyfile
+cryptsetup --pbkdf pbkdf2 -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk1 /keyfile
+cryptsetup --pbkdf pbkdf2 -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk2 /keyfile
 cryptsetup luksOpen /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk1 dracut_disk1 < /keyfile
 cryptsetup luksOpen /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_disk2 dracut_disk2 < /keyfile
 mdadm --create /dev/md0 --run --auto=yes --level=1 --metadata=0.90 --raid-devices=2 /dev/mapper/dracut_disk1 /dev/mapper/dracut_disk2
index 2d0d09829be61eb533b64a4ac72c872b58541210..d8b2b13e0d86a12ac434ef6e419d4d52052c94bb 100755 (executable)
@@ -6,7 +6,7 @@ set -e
 modprobe btrfs || :
 mkfs.btrfs -q -L dracut /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root
 printf test > keyfile
-cryptsetup -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_crypt /keyfile
+cryptsetup --pbkdf pbkdf2 -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_crypt /keyfile
 cryptsetup luksOpen /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_crypt dracut_crypt_test < /keyfile
 mkfs.btrfs -q -L dracut_crypt /dev/mapper/dracut_crypt_test
 mkfs.btrfs -q -L dracutusr /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr
index 4eb0d4f0e776ac5261bb1d8c8521f0f3fa48ef28..35ed3af5baeac26983714504b34200350939c4e7 100755 (executable)
@@ -4,7 +4,7 @@ trap 'poweroff -f' EXIT
 set -ex
 
 printf test > keyfile
-cryptsetup -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /keyfile
+cryptsetup --pbkdf pbkdf2 -q luksFormat /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /keyfile
 echo "The passphrase is test"
 cryptsetup luksOpen /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root dracut_crypt_test < /keyfile
 lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test