]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Harden check for used modules in hostonly mode
authorAndrey Borzenkov <arvidjaar@mail.ru>
Sun, 9 May 2010 18:23:58 +0000 (22:23 +0400)
committerHarald Hoyer <harald@redhat.com>
Wed, 4 Aug 2010 16:30:02 +0000 (18:30 +0200)
Make sure that we do not accept module name which is substring of
some other module name. This resulted in piix being mistakenly loaded
together with ata_piix. It completely broke DVD access here.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
dracut-functions

index a1873c5dedd9dd86f0ede78d267316208ba3267d..c9affc7448079c4a18683d64bc4b1d6cd8d9525e 100755 (executable)
@@ -657,7 +657,7 @@ instmods() {
                [[ -f $initdir/$1 ]] && { shift; continue; }
                # If we are building a host-specific initramfs and this
                # module is not already loaded, move on to the next one.
-               [[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
+               [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \
                ! echo $add_drivers | grep -qe "\<${mod}\>" &&  {
                    shift; continue; 
                }