DHCP and NFSroot/TFTP

Juergen Beisert jbe at pengutronix.de
Fri Jul 22 07:16:35 EDT 2011


Hi,

for the case someone uses DHCP for her/his network configuration in Barebox,
there is a race with the setup of some variables used for the NFS root.

The following patch fixes it, but maybe there are better solutions than that.

------------------------------------------------------------------------------

Setting up NFS root/TFTP related variables is successfull only if the network
interface is already configured. For the case someone is using DHCP, this
fails, because all these vars are still empty. Changing the order when the
DHCP is done solves the issue.

Signed off by: Juergen Beisert <jbe at pengutronix.de>

---
 defaultenv/bin/boot |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: barebox-2011.05.0/defaultenv/bin/boot
===================================================================
--- barebox-2011.05.0.orig/defaultenv/bin/boot
+++ barebox-2011.05.0/defaultenv/bin/boot
@@ -18,6 +18,9 @@ fi
 
 if [ x$ip = xdhcp ]; then
 	bootargs="$bootargs ip=dhcp"
+	if [ x$kernel_loc = xnfs ] || [ x$kernel_loc = xtftp ]; then
+		dhcp
+	fi
 elif [ x$ip = xnone ]; then
 	bootargs="$bootargs ip=none"
 else
@@ -75,9 +78,6 @@ if [ ! -e /dev/ram0.kernel ]; then
 fi
 
 if [ x$kernel_loc = xnfs ] || [ x$kernel_loc = xtftp ]; then
-	if [ x$ip = xdhcp ]; then
-		dhcp
-	fi
 	if [ $kernelimage_type = uimage ]; then
 		netload="/dev/ram0.kernel"
 	elif [ $kernelimage_type = zimage ]; then

Juergen

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |



More information about the barebox mailing list