diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
commit | ae3ecffbd2e40760fef5dc09db30ea8a81abec70 (patch) | |
tree | f3b77bfda1bae06d3326ef27c3cb61539e7f93cc /test/TEST-16-DMSQUASH | |
parent | Adding debian version 102-3. (diff) | |
download | dracut-ae3ecffbd2e40760fef5dc09db30ea8a81abec70.tar.xz dracut-ae3ecffbd2e40760fef5dc09db30ea8a81abec70.zip |
Merging upstream version 103.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-16-DMSQUASH')
-rwxr-xr-x | test/TEST-16-DMSQUASH/create-root.sh | 12 | ||||
-rwxr-xr-x | test/TEST-16-DMSQUASH/test.sh | 44 |
2 files changed, 46 insertions, 10 deletions
diff --git a/test/TEST-16-DMSQUASH/create-root.sh b/test/TEST-16-DMSQUASH/create-root.sh index b424a1a..042d974 100755 --- a/test/TEST-16-DMSQUASH/create-root.sh +++ b/test/TEST-16-DMSQUASH/create-root.sh @@ -27,6 +27,18 @@ cp -a -t /root /source/* echo "Creating squashfs" mksquashfs /source /root/testdir/rootfs.img -quiet +# Write the erofs compressed filesystem to the partition +if [ -e "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_erofs" ]; then + sfdisk /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_erofs << EOF +2048,161792 +EOF + + udevadm settle + + echo "Creating erofs" + mkfs.erofs /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_erofs-part1 /source +fi + # Copy rootfs.img to the NTFS drive if exists if [ -e "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_ntfs" ]; then mkfs.ntfs -q -F -L dracut_ntfs /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_ntfs diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 6087ccd..4245c20 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -12,6 +12,11 @@ test_run() { qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker qemu_add_drive disk_index disk_args "$TESTDIR"/root.img root + # erofs drive + if modprobe erofs &> /dev/null && command -v mkfs.erofs &> /dev/null; then + qemu_add_drive disk_index disk_args "$TESTDIR"/root_erofs.img root_erofs + fi + # NTFS drive if modprobe --dry-run ntfs3 &> /dev/null && command -v mkfs.ntfs &> /dev/null; then qemu_add_drive disk_index disk_args "$TESTDIR"/root_ntfs.img root_ntfs @@ -21,16 +26,28 @@ test_run() { "$testdir"/run-qemu \ "${disk_args[@]}" \ -boot order=d \ - -append "rd.live.overlay.overlayfs=1 root=live:/dev/disk/by-label/dracut" \ + -append "$TEST_KERNEL_CMDLINE rd.live.overlay.overlayfs=1 root=live:/dev/disk/by-label/dracut" \ -initrd "$TESTDIR"/initramfs.testing test_marker_check || return 1 + # Run the erofs test only if mkfs.ntfs is available + if modprobe erofs &> /dev/null && command -v mkfs.erofs &> /dev/null; then + test_marker_reset + "$testdir"/run-qemu \ + "${disk_args[@]}" \ + -boot order=d \ + -append "$TEST_KERNEL_CMDLINE rd.live.overlay.overlayfs=1 root=live:/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root_erofs-part1" \ + -initrd "$TESTDIR"/initramfs.testing + + test_marker_check || return 1 + fi + test_marker_reset "$testdir"/run-qemu \ "${disk_args[@]}" \ -boot order=d \ - -append "rd.live.image rd.live.overlay.overlayfs=1 root=LABEL=dracut" \ + -append "$TEST_KERNEL_CMDLINE rd.live.image rd.live.overlay.overlayfs=1 root=LABEL=dracut" \ -initrd "$TESTDIR"/initramfs.testing test_marker_check || return 1 @@ -39,7 +56,7 @@ test_run() { "$testdir"/run-qemu \ "${disk_args[@]}" \ -boot order=d \ - -append "rd.live.image rd.live.overlay.overlayfs=1 rd.live.dir=testdir root=LABEL=dracut" \ + -append "$TEST_KERNEL_CMDLINE rd.live.image rd.live.overlay.overlayfs=1 rd.live.dir=testdir root=LABEL=dracut" \ -initrd "$TESTDIR"/initramfs.testing test_marker_check || return 1 @@ -50,7 +67,7 @@ test_run() { "$testdir"/run-qemu \ "${disk_args[@]}" \ -boot order=d \ - -append "rd.live.image rd.live.overlay.overlayfs=1 rd.live.dir=testdir root=LABEL=dracut_ntfs quiet rd.info rd.shell=0" \ + -append "$TEST_KERNEL_CMDLINE rd.live.image rd.live.overlay.overlayfs=1 rd.live.dir=testdir root=LABEL=dracut_ntfs" \ -initrd "$TESTDIR"/initramfs.testing test_marker_check || return 1 @@ -63,7 +80,7 @@ test_run() { "$testdir"/run-qemu \ "${disk_args[@]}" \ -boot order=d \ - -append "init=/sbin/init-persist rd.live.image rd.live.overlay.overlayfs=1 rd.live.overlay=LABEL=persist rd.live.dir=testdir root=LABEL=dracut console=ttyS0,115200n81 quiet selinux=0 rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \ + -append "init=/sbin/init-persist rd.live.image rd.live.overlay.overlayfs=1 rd.live.overlay=LABEL=persist rd.live.dir=testdir root=LABEL=dracut console=ttyS0,115200n81 quiet rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \ -initrd "$TESTDIR"/initramfs.testing-autooverlay rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]') @@ -92,8 +109,8 @@ test_setup() { # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. "$DRACUT" -N -l -i "$TESTDIR"/overlay / \ - --modules "test-makeroot" \ - --install "sfdisk mkfs.ntfs mksquashfs" \ + --add "test-makeroot" \ + --install "sfdisk mkfs.ntfs mksquashfs mkfs.erofs" \ --drivers "ntfs3" \ --include ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ --force "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1 @@ -105,6 +122,11 @@ test_setup() { qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1 qemu_add_drive disk_index disk_args "$TESTDIR"/root.img root 160 + # erofs drive + if modprobe erofs &> /dev/null && command -v mkfs.erofs &> /dev/null; then + qemu_add_drive disk_index disk_args "$TESTDIR"/root_erofs.img root_erofs 160 + fi + # NTFS drive if modprobe --dry-run ntfs3 &> /dev/null && command -v mkfs.ntfs &> /dev/null; then dd if=/dev/zero of="$TESTDIR"/root_ntfs.img bs=1MiB count=160 @@ -114,7 +136,7 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. "$testdir"/run-qemu \ "${disk_args[@]}" \ - -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81 selinux=0" \ + -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81" \ -initrd "$TESTDIR"/initramfs.makeroot || return 1 if ! test_marker_check dracut-root-block-created; then @@ -128,14 +150,16 @@ SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs3" EOF test_dracut \ - --modules "dash dmsquash-live qemu" \ + --add "dash dmsquash-live qemu" \ + --omit "systemd" \ --drivers "ntfs3" \ --install "mkfs.ext4" \ --include /tmp/ntfs3.rules /lib/udev/rules.d/ntfs3.rules \ "$TESTDIR"/initramfs.testing test_dracut \ - --modules "dmsquash-live-autooverlay qemu" \ + --add "dmsquash-live-autooverlay qemu" \ + --omit "systemd" \ --install "mkfs.ext4" \ "$TESTDIR"/initramfs.testing-autooverlay |