From: Laszlo Gombos Date: Wed, 24 Aug 2022 19:16:26 +0000 (+0000) Subject: fix(dracut.sh): make omit-drivers option do exact match for names X-Git-Tag: 058~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=444944ab37c2446adf07dd163225707e90aabef3;p=thirdparty%2Fdracut.git fix(dracut.sh): make omit-drivers option do exact match for names Modify the basic test case to use --omit-drivers and make it fail without the PR and make it pass with the PR. The test would fail with the following error without the PR: FATAL: iscsiroot requested but kernel/initrd does not support iscsi --- diff --git a/dracut.sh b/dracut.sh index 78801a426..5b10b5a6e 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1345,7 +1345,7 @@ omit_drivers_corrected="" for d in $omit_drivers; do [[ " $drivers $add_drivers " == *\ $d\ * ]] && continue [[ " $drivers $force_drivers " == *\ $d\ * ]] && continue - omit_drivers_corrected+="$d|" + omit_drivers_corrected+="^$d$|" done omit_drivers="${omit_drivers_corrected%|}" unset omit_drivers_corrected diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 38f3ab205..b782e7ee1 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -108,9 +108,12 @@ test_setup() { inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh ) + + # make sure --omit-drivers does not filter out drivers using regexp to test for an earlier regression (assuming there is no one letter linux kernel module needed to run the test) "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ -a "debug watchdog" \ -d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \ + --omit-drivers 'a b c d e f g h i j k l m n o p q r s t u v w x y z' \ --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 }