Skip to contentSkip to conversation

DHCP and NFSroot/TFTP

PATCH Juergen Beisert 1 participant 1 message Jul 22, 2011

lore
Share & tools
lore
#0 lore raw

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 <[email protected]>

---
 defaultenv/bin/boot |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
defaultenv/bin/boot +3 -3
Index: 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

Signature · 9 lines
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/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox