]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Remove a useless use of cat in instmods
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 6 Mar 2009 19:50:04 +0000 (13:50 -0600)
committerVictor Lowther <victor.lowther@gmail.com>
Fri, 6 Mar 2009 19:50:04 +0000 (13:50 -0600)
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

index ac37bb2ee1b995a15cefb93bebf627b0109870e3..77857a4de813f642f746b869fdd1ed1c81614b11 100755 (executable)
@@ -154,7 +154,8 @@ inst_rules() {
 # Same args as above.
 inst() {
     if (($# != 1 && $# != 2 )); then
-        echo "usage: inst <file> [<destination file>]"
+        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