netroot: Don't export NEWROOT
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Tue, 16 Jun 2009 08:46:30 +0000 (10:46 +0200)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Wed, 17 Jun 2009 06:37:39 +0000 (08:37 +0200)
Exporting NEWROOT to handlers when we already pass them two other
arguments doesn't make sense. Passing it as a third argument is
better.

modules.d/40network/netroot
modules.d/95nbd/nbdroot
modules.d/95nfs/nfsroot

index d874799..75313ba 100755 (executable)
@@ -45,8 +45,7 @@ fi
 
 # Run the handler; don't store the root, it may change from device to device
 # XXX other variables to export?
-export NEWROOT
-if $handler $netif $netroot; then
+if $handler $netif $netroot $NEWROOT; then
     # Network rootfs mount successful
     [ -f /tmp/dhclient.$netif.lease ] &&    cp /tmp/dhclient.$netif.lease    /tmp/net.$netif.lease
     [ -f /tmp/dhclient.$netif.dhcpopts ] && cp /tmp/dhclient.$netif.dhcpopts /tmp/net.$netif.dhcpopts
index b7f4cc4..2302696 100755 (executable)
@@ -15,6 +15,7 @@ fi
 # root is in the form root=nbd:server:port:fstype:fsopts:nbdopts
 netif="$1"
 root="$2"
+NEWROOT="$3"
 
 root=${root#nbd:}
 nbdserver=${root%%:*}; root=${root#*:}
index d0189be..849fadf 100755 (executable)
@@ -15,6 +15,7 @@ getarg rdnetdebug && {
 # root is in the form root=nfs[4]:server:path:[options]
 netif="$1"
 root="$2"
+NEWROOT="$3"
 
 nfsver=${root%%:*}; root=${root#*:}
 nfsserver=${root%%:*}; root=${root#*:}