]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add source_conf for static configuration variables
authorHarald Hoyer <harald@redhat.com>
Fri, 24 Jul 2009 11:10:55 +0000 (13:10 +0200)
committerHarald Hoyer <harald@redhat.com>
Sat, 25 Jul 2009 09:09:34 +0000 (11:09 +0200)
source_conf sources all *.conf files of a directory

init will now source all /etc/conf.d/*.conf files

modules.d/95iscsi/iscsiroot
modules.d/99base/dracut-lib.sh
modules.d/99base/init

index 5eff62503eef717afa84f6fe0f81f47b3a4e5614..f0dbdaaa366b44b3361d5a4aebcc014e095399b0 100755 (executable)
@@ -30,10 +30,7 @@ fi
 netif="$1"
 root="$2"
 
-# read static conf settings
-for conf in conf/conf.d/*; do
-    [ -f ${conf} ] && . ${conf}
-done
+source_all /etc/conf.d
 
 # If it's not iscsi we don't continue
 [ "${root%%:*}" = "iscsi" ] || exit 1
index f9182cfd773583aab4f8b4493b618569365c9856..f007fccf8f9109607cddca6ae28956e579d53486 100644 (file)
@@ -28,6 +28,12 @@ source_all() {
     for f in "/$1"/*.sh; do [ -f "$f" ] && . "$f"; done
 }
 
+source_conf() {
+    local f
+    [ "$1" ] && [  -d "/$1" ] || return
+    for f in "/$1"/*.conf; do [ -f "$f" ] && . "$f"; done
+}
+
 die() {
     {
         echo "<1>dracut: FATAL: $@";
index 431d2e8e8c6b79f65dbf5390be8d794ea39d5dd9..36f1a0783151f86f637edf0d37e82c364b8e1115 100755 (executable)
@@ -59,6 +59,8 @@ mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1
 
 UDEVVERSION=$(udevadm --version)
 
+source_conf /etc/conf.d
+
 # run scriptlets to parse the command line
 getarg 'rdbreak=cmdline' && emergency_shell "Break before cmdline"
 source_all cmdline