]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
priorize -m over dracut.conf, add --modules and get rid of automatic use of ./dracut...
authorSeewer Philippe <philippe.seewer@bfh.ch>
Sat, 7 Mar 2009 10:53:40 +0000 (11:53 +0100)
committerHarald Hoyer <harald@redhat.com>
Sat, 7 Mar 2009 11:04:02 +0000 (12:04 +0100)
Victor Lowther introduced -c to freely set dracut.conf. Means we can get
rid of automatic use of ./dracut.conf if -l is used, use -c instead.

Second this patch prefers options before config files and adds an option
-d|--drivers to set the modules= option.

Patch is built on top of Harald Hoyers merge tree
(git://git.surfsite.org/pub/git/dracut.git)

dracut

diff --git a/dracut b/dracut
index d8da6d69a78af640404649ff7a30a3ab8be60375..dad66877e85a0629c49b09be0235394f8b4e8748 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -11,7 +11,8 @@
 while (($# > 0)); do
     case $1 in
        -f|--force) force=yes;;
-       -m|--modules) dracutmodules="$2"; shift;;
+       -m|--modules) dracutmodules_l="$2"; shift;;
+       -d|--drivers) modules_l="$2"; shift;;
        -h|--help) echo "Usage: $0 [-f] <initramfs> <kernel-version>"
            exit 1 ;;
        -v|--verbose) set -x;;
@@ -22,11 +23,12 @@ while (($# > 0)); do
     esac
     shift
 done
-[[ -f $conffile ]] || {
-    conffile="/etc/dracut.conf"
-    [[ $allowlocal && -f dracut.conf ]] && conffile="dracut.conf"
-}
-. "$conffile"
+
+[[ -f $conffile ]] || [[ -f /etc/dracut.conf ]] && conffile="/etc/dracut.conf"
+[[ -f $conffile ]] && . "$conffile"
+
+[[ $dracutmodules_l ]] && dracutmodules=$dracutmodule_l
+[[ $modules_l ]] && modules=$modules_l
 
 [[ $allowlocal && -f dracut-functions ]] && dsrc="." || dsrc=/usr/lib/dracut
 . $dsrc/dracut-functions