From 74534e19c9a3c898800540712d904c1cb83a216a Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Fri, 6 Mar 2009 13:50:04 -0600 Subject: [PATCH] Remove a useless use of cat in instmods We also need to decide whenter we are going to support modules.* files. Not only are they Fedora-specific, but doing so makes =* arguments to instmods have two different and incompatible meanings depending on whether that file exists. --- dracut-functions | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dracut-functions b/dracut-functions index ac37bb2e..77857a4d 100755 --- a/dracut-functions +++ b/dracut-functions @@ -154,7 +154,8 @@ inst_rules() { # Same args as above. inst() { if (($# != 1 && $# != 2 )); then - echo "usage: inst []" + echo "dracut error: inst only takes 1 or 2 arguments" + exit 1 fi for x in inst_symlink inst_script inst_binary inst_simple; do $x "$@" && return 0 @@ -194,11 +195,12 @@ instmods() { while (($# > 0)); do mod=${1%.ko} case $mod in - =*) + =*) # This introduces 2 incompatible menaings for =* arguments + # to instmods. We need to decide which one to keep. if [ "$mod" = "=ata" -a -f $srcmods/modules.block ] ; then - instmods $mpargs $(cat "${srcmods}/modules.block" |egrep 'ata|ahci') + instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") elif [ -f $srcmods/modules.${mod#=} ]; then - instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) + instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) else instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") fi