From: Christoph Fritz <chf.fritz@googlemail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: [PATCH 1/2] net: add nameserver IPs to kernel-parameter ip=
Date: Sat, 22 Sep 2012 12:58:50 +0200 [thread overview]
Message-ID: <1348311530.3917.5.camel@mars> (raw)
Kernel-parameter "ip=" is used to assign network configuration.
With linux kernel 3.7 it is also possible to set nameserver IPs.
This patch adds two new options (nameserver0 and nameserver1) to
ethernet device parameter. It also updates defaultenv version 1.
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
defaultenv/bin/boot | 4 +++-
defaultenv/config | 2 ++
net/eth.c | 2 ++
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
index 4e2056e..d5b5844 100644
--- a/defaultenv/bin/boot
+++ b/defaultenv/bin/boot
@@ -61,7 +61,9 @@ if [ x$ip = xdhcp -o ]; then
elif [ x$ip = xnone ]; then
bootargs="$bootargs ip=none"
else
- bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask::eth0:"
+ bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:"
+ bootargs="$bootargs$eth0.netmask::eth0::"
+ bootargs="$bootargs$eth0.nameserver0:$eth0.nameserver1"
fi
diff --git a/defaultenv/config b/defaultenv/config
index 391ba47..6596753 100644
--- a/defaultenv/config
+++ b/defaultenv/config
@@ -18,6 +18,8 @@ global.dhcp.vendor_id=barebox
#eth0.netmask=a.b.c.d
#eth0.serverip=a.b.c.d
#eth0.gateway=a.b.c.d
+#eth0.nameserver0=a.b.c.d
+#eth0.nameserver1=a.b.c.d
# can be either 'tftp', 'nfs', 'nand', 'nor' or 'disk'
kernel_loc=tftp
diff --git a/net/eth.c b/net/eth.c
index d42a72d..bb8157b 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -229,6 +229,8 @@ int eth_register(struct eth_device *edev)
dev_add_param(dev, "gateway", eth_set_ipaddr, NULL, 0);
dev_add_param(dev, "netmask", eth_set_ipaddr, NULL, 0);
dev_add_param(dev, "serverip", eth_set_ipaddr, NULL, 0);
+ dev_add_param(dev, "nameserver0", eth_set_ipaddr, NULL, 0);
+ dev_add_param(dev, "nameserver1", eth_set_ipaddr, NULL, 0);
edev->init(edev);
--
1.7.2.5
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2012-09-22 10:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-22 10:58 Christoph Fritz [this message]
2012-09-22 11:43 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-22 15:41 ` [PATCH 1/2][v2] " Christoph Fritz
2012-09-22 18:24 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-22 18:27 ` [PATCH 1/1] net: add multiple nameserver support Jean-Christophe PLAGNIOL-VILLARD
2012-09-22 19:25 ` Christoph Fritz
2012-09-22 20:16 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-23 12:11 ` [PATCH] " Christoph Fritz
2012-09-23 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-23 13:57 ` Christoph Fritz
2012-12-10 11:23 ` Christoph Fritz
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=1348311530.3917.5.camel@mars \
--to=chf.fritz@googlemail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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