]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut_install: add "-o" option
authorMarc Grimme <grimme@atix.de>
Thu, 23 Jul 2009 10:15:54 +0000 (12:15 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 23 Jul 2009 10:15:54 +0000 (12:15 +0200)
Calling dracut_install will optionally install the file. This is useful
for the debug module.

dracut-functions

index 6fef83aca8ace7fab7f14897346581aba34e365f..97de9b4e557ecf773e5ddb41cd5d658fb02dc423 100755 (executable)
@@ -200,12 +200,25 @@ inst_hook() {
 }
 
 dracut_install() {
+    local optional=
     while (($# > 0)); do
+        # Might be nice to optionally install a binary
+        if [ "$1" == "-o" ]; then
+           optional="yes"
+           shift
+           continue
+        fi
        if inst "$1" ; then
             shift 
             continue
         fi
-        derror "Failed to install $1"; exit 1
+        if [ "$optional" == "yes" ]; then
+          dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
+          shift
+          continue
+        else
+          derror "Failed to install $1"; exit 1
+        fi
     done
 }