From: Philippe Seewer Date: Tue, 16 Jun 2009 09:35:49 +0000 (+0200) Subject: netroot: Use same method to check for already mounted root as init X-Git-Tag: 0.1~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a55d10c05ca60746b1888c9a6e5a167bb108b223;p=platform%2Fupstream%2Fdracut.git netroot: Use same method to check for already mounted root as init base/init uses [ -d "$NEWROOT/proc" ] to check if root is mounted or not. Netroot should do the same. In addition this gets rid of another file in /tmp, since /tmp/netroot.done isn't needed anymore. --- diff --git a/modules.d/40network/netroot b/modules.d/40network/netroot index 53be6cf..31c899b 100755 --- a/modules.d/40network/netroot +++ b/modules.d/40network/netroot @@ -23,23 +23,17 @@ getarg rdnetdebug && { exit 1 } -netif=$1 +# There's no sense in doing something if no (net)root info is available +# or root is already there +[ -e /tmp/root.info ] || exit 1 +. /tmp/root.info +[ -d $NEWROOT/proc ] && exit 0 +[ -z "$netroot" ] && exit 1 -# If we've already found a root, or we don't have the info we need, -# then no point in looking further -# -[ -e /tmp/netroot.done ] && exit 0 -[ -f /tmp/root.info ] || exit 1 +netif=$1 -# Pick up our config from the command line; we may already know the -# handler to run -# -. /tmp/root.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 @@ -75,6 +69,5 @@ if $handler $netif $netroot $NEWROOT; then #DNS2=1.2.3.5 #GATEWAY=172.16.101.254 fi - >/tmp/netroot.done fi exit 0