]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
netroot: Use root.info instead of netroot.info
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Tue, 16 Jun 2009 09:26:29 +0000 (11:26 +0200)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Wed, 17 Jun 2009 06:37:39 +0000 (08:37 +0200)
Having two files which are used more or less at the same time isn't
that easy to handle and read. Instead, move the contents of netroot.info
to root.info and only use root.info. This is cleaner and makes debugging
easier.

modules.d/40network/dhcp-fallback.sh
modules.d/40network/ifup
modules.d/40network/netroot
modules.d/99base/init

index 484a1214f082a603c1b369e7e999ccae644634ef..6bc823fac78312a34519470d0007f163cb370fa4 100755 (executable)
@@ -14,7 +14,3 @@ fi
 if [ "$netroot" = "$root" ]; then
     unset root
 fi
-
-if [ "${netroot+set}" = "set" ]; then
-    eval "echo netroot='$netroot'" > /tmp/netroot.info
-fi
index d24133236611c7020149790a2c6aa576d94c1df1..4009bdcbeee6aa73a215d376fbbc7b3609dbf828 100755 (executable)
@@ -15,7 +15,9 @@ netif=$1
 # bail immediately if the interface is already up
 # or we don't need the network
 [ -f "/tmp/net.$netif.up" ] && exit 0
-[ ! -f /tmp/netroot.info ] && exit 0
+[ -f "/tmp/root.info" ] || exit 0
+. /tmp/root.info
+[ -z "$netroot" ] && exit 0
 
 # loopback is always handled the same way
 [ "$netif" = "lo" ] && {
index a2ef22fdedf687827fb39ef56793b6ac6aadfdd8..53be6cf6d91834c13778a2c2dcf60ece67a167c4 100755 (executable)
@@ -29,15 +29,17 @@ netif=$1
 # then no point in looking further
 #
 [ -e /tmp/netroot.done ] && exit 0
-[ -s /tmp/netroot.info -a -s /tmp/root.info ] || exit 0
+[ -f /tmp/root.info ] || exit 1
 
 # Pick up our config from the command line; we may already know the
 # handler to run
 #
 . /tmp/root.info
-. /tmp/netroot.info
 [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
 
+# Don't continue if netroot isn't needed
+[ -z "$netroot" ] && exit 0
+
 # Now, let the installed network root handlers figure this out
 #
 source_all netroot
index 644b62af889177446ec4a56c152fd02dde86f4c1..e417993d9e669e14e9e0631248b77dd5de42e36a 100755 (executable)
@@ -59,6 +59,7 @@ fi
     echo "root='$root'"
     echo "rflags='$rflags'"
     echo "fstype='$fstype'"
+    echo "netroot='$netroot'"
     echo "NEWROOT='$NEWROOT'"
 } > /tmp/root.info