mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: DHCP and NFSroot/TFTP
Date: Fri, 22 Jul 2011 13:16:35 +0200	[thread overview]
Message-ID: <201107221316.35943.jbe@pengutronix.de> (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 <jbe@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/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2011-07-22 11:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107221316.35943.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox