Am 02.06.2011 21:28, schrieb Dave Reisner: > Simplify the code used to generate and read from the early userspace > blacklist by turning the contents of the $disablemodules variable into > /run/modprobe.d/initcpio.conf. This removes the need for the loop in > parsing the $MODULES variable -- we simply invoke modprobe with -b, to > respect any blacklisting. > > Signed-off-by: Dave Reisner <[email protected]> > --- > This is some low hanging fruit I noticed after the last patch I submitted. > Requires module-init-tools 3.13. > > > init | 12 ++---------- > 1 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/init b/init > index 87ff187..d2c2d9b 100644 > --- a/init > +++ b/init > @@ -46,9 +46,7 @@ if [ -n "${disablehooks}" ]; then > fi > > if [ -n "${disablemodules}" ]; then > - for d in $(echo "${disablemodules}" | sed 's|,| |g'); do > - eval "mod_${d}=disabled" > - done > + printf 'blacklist %s\n' ${disablemodules//,/ } > > /run/modprobe.d/initcpio.conf > fi > > if [ -n "${earlymodules}" ]; then > @@ -59,13 +57,7 @@ fi > > . /config > > -for m in ${MODULES}; do > - TST="" > - eval "TST=\$mod_${m}" > - if [ "${TST}" != "disabled" ]; then > - /sbin/modprobe -q ${m} > /dev/null 2>&1 > - fi > -done > +/sbin/modprobe -qab $MODULES > > # If rootdelay is empty or not a non-negative integer, set it to 10 > if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then
This is still too much. I said earlier that disablemodules= is not supported anymore, so this code needs to be removed, I just forgot.
signature.asc
Description: OpenPGP digital signature
