Skip to content

Commit 444944a

Browse files
LaszloGombosjohannbg
authored andcommitted
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
1 parent cc1c0ff commit 444944a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: dracut.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ omit_drivers_corrected=""
13451345
for d in $omit_drivers; do
13461346
[[ " $drivers $add_drivers " == *\ $d\ * ]] && continue
13471347
[[ " $drivers $force_drivers " == *\ $d\ * ]] && continue
1348-
omit_drivers_corrected+="$d|"
1348+
omit_drivers_corrected+="^$d$|"
13491349
done
13501350
omit_drivers="${omit_drivers_corrected%|}"
13511351
unset omit_drivers_corrected

Diff for: test/TEST-01-BASIC/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ test_setup() {
108108
inst_hook shutdown-emergency 000 ./hard-off.sh
109109
inst_hook emergency 000 ./hard-off.sh
110110
)
111+
112+
# 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)
111113
"$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
112114
-a "debug watchdog" \
113115
-d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \
116+
--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' \
114117
--no-hostonly-cmdline -N \
115118
-f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
116119
}

0 commit comments

Comments
 (0)