]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: if called with "-l" read only local dracut.conf
authorHarald Hoyer <harald@redhat.com>
Fri, 9 Oct 2009 11:15:32 +0000 (13:15 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 9 Oct 2009 11:15:32 +0000 (13:15 +0200)
dracut

diff --git a/dracut b/dracut
index 5c538b8238e0eaf3a171195ac2234f28402c0977..c5e9ea77a35421714c3adb99f94e9fc8defcfa96 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -108,8 +108,13 @@ export PATH
     set -x
 }
 
+[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
+
 # if we were not passed a config file, try the default one
-[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
+if [[ ! -f $conffile ]]; then
+    [[ $allowlocal ]] || conffile="/etc/dracut.conf"
+    [[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
+fi
 
 # source our config file
 [[ -f $conffile ]] && . "$conffile"
@@ -134,8 +139,6 @@ fw_dir=${fw_dir//:/ }
 
 [[ $hostonly = yes ]] && hostonly="-h"
 
-[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
-
 if [[ -f $dsrc/dracut-functions ]]; then
    . $dsrc/dracut-functions
 else