From: Andrey Borzenkov Date: Sun, 9 May 2010 18:23:58 +0000 (+0400) Subject: Harden check for used modules in hostonly mode X-Git-Tag: 007~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=62f8a2b63cdf71e70a6ba723fce869ea769d01ad;p=thirdparty%2Fdracut.git Harden check for used modules in hostonly mode 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 --- diff --git a/dracut-functions b/dracut-functions index a1873c5de..c9affc744 100755 --- a/dracut-functions +++ b/dracut-functions @@ -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; }