mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] net: add nameserver IPs to kernel-parameter ip=
@ 2012-09-22 10:58 Christoph Fritz
  2012-09-22 11:43 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Fritz @ 2012-09-22 10:58 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-10 11:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-22 10:58 [PATCH 1/2] net: add nameserver IPs to kernel-parameter ip= Christoph Fritz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox