mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] defaultenv-2 ifup: Always overwrite eth0.serverip
Date: Thu,  7 Jun 2012 22:37:34 +0200	[thread overview]
Message-ID: <1339101456-8116-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1339101456-8116-1-git-send-email-s.hauer@pengutronix.de>

if serverip is specified, also overwrite eth0.serverip in dhcp
case. This makes it possible to specify a different serverip
when the dhcp server returns the wrong ip (because the DHCP
might be a DSL router which does not provide tftp).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 defaultenv-2/base/bin/ifup |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/defaultenv-2/base/bin/ifup b/defaultenv-2/base/bin/ifup
index 9f6fd6b..ed33b06 100644
--- a/defaultenv-2/base/bin/ifup
+++ b/defaultenv-2/base/bin/ifup
@@ -53,7 +53,12 @@ if [ "$ip" = static ]; then
 	${interface}.gateway=$gateway
 elif [ "$ip" = dhcp ]; then
 	dhcp
-	exit $?
+	ret=$?
+	if [ $ret = 0 -a -n "$serverip" ]; then
+		${interface}.serverip=$serverip
+	fi
+
+	exit $ret
 fi
 
 echo -o /tmp/network/$interface up
-- 
1.7.10


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

  reply	other threads:[~2012-06-07 20:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 20:37 defenv-2 updates Sascha Hauer
2012-06-07 20:37 ` Sascha Hauer [this message]
2012-06-07 20:37 ` [PATCH 2/3] defaultenv-2: mount tftp server specified in $eth0.serverip Sascha Hauer
2012-06-07 20:37 ` [PATCH 3/3] defaultenv-2: remove global.tftp.path Sascha Hauer

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=1339101456-8116-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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