Skip to contentSkip to conversation

defaultenv-2: add nameserver IPs to kernel-parameter ip=

PATCH Superseded Christoph Fritz 2 participants 3 messages Sep 22, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 defaultenv-2: add nameserver IPs to kernel-parameter ip=

Due to lack of testing environment this patch is untested.

---
 defaultenv-2/base/bin/bootargs-ip         |    4 +++-
 defaultenv-2/base/bin/bootargs-ip-barebox |    5 ++++-
 defaultenv-2/base/bin/ifup                |    4 ++++
 defaultenv-2/base/network/eth0            |    2 ++
 4 files changed, 13 insertions(+), 2 deletions(-)
defaultenv-2/base/bin/bootargs-ip +3 -1
index 2d4486c..53623853 100644
@@ -7,5 +7,7 @@
 if [ $ip = dhcp ]; then
 	global.linux.bootargs.dyn.ip="ip=dhcp"
 else
-	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0:"
+	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0::"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver0:"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver1"
 fi
defaultenv-2/base/bin/bootargs-ip-barebox +4 -1
index 5a3b984..09f42a8 100644
@@ -4,4 +4,7 @@
 
 ifup eth0
 
-global.linux.bootargs.dyn.ip="ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask::eth0:"
+global.linux.bootargs.dyn.ip="ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.netmask::eth0::"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver0:"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver1"
defaultenv-2/base/bin/ifup +4 -0
index 37b986c..fe5a242 100644
@@ -26,6 +26,8 @@ netmask=
 gateway=
 serverip=
 ethaddr=
+nameserver0=
+nameserver1=
 
 . $cmd
 
@@ -51,6 +53,8 @@ if [ "$ip" = static ]; then
 	${interface}.netmask=$netmask
 	${interface}.serverip=$serverip
 	${interface}.gateway=$gateway
+	${interface}.nameserver0=$nameserver0
+	${interface}.nameserver1=$nameserver1
 	ret=0
 elif [ "$ip" = dhcp ]; then
 	dhcp
defaultenv-2/base/network/eth0 +2 -0
index 7e731ca..2ed64ca 100644
@@ -9,6 +9,8 @@ ipaddr=
 netmask=
 gateway=
 serverip=
+nameserver0=
+nameserver1=
 
 # MAC address if needed
 #ethaddr=xx:xx:xx:xx:xx:xx
Signature · 9 lines
1.7.2.5




_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 15 lines · Christoph Fritz

Due to lack of testing environment this patch is untested.

---
 defaultenv-2/base/bin/bootargs-ip         |    4 +++-
 defaultenv-2/base/bin/bootargs-ip-barebox |    5 ++++-
 defaultenv-2/base/bin/ifup                |    4 ++++
 defaultenv-2/base/network/eth0            |    2 ++
 4 files changed, 13 insertions(+), 2 deletions(-)
defaultenv-2/base/bin/bootargs-ip +0 -0
index 2d4486c..53623853 100644

defaultenv-2/base/bin/bootargs-ip line 12

Quoted 7 lines
defaultenv-2/base/bin/bootargs-ip +3 -1
@@ -7,5 +7,7 @@
 if [ $ip = dhcp ]; then
 	global.linux.bootargs.dyn.ip="ip=dhcp"
 else
-	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0:"
+	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0::"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver0:"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver1"

keep it on one line for grepping

Quoted 28 lines
defaultenv-2/base/bin/bootargs-ip +0 -0
 fi
defaultenv-2/base/bin/bootargs-ip-barebox +4 -1
index 5a3b984..09f42a8 100644
@@ -4,4 +4,7 @@
 
 ifup eth0
 
-global.linux.bootargs.dyn.ip="ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask::eth0:"
+global.linux.bootargs.dyn.ip="ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.netmask::eth0::"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver0:"
+global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver1"
defaultenv-2/base/bin/ifup +2 -0
index 37b986c..fe5a242 100644
@@ -26,6 +26,8 @@ netmask=
 gateway=
 serverip=
 ethaddr=
+nameserver0=
+nameserver1=
 
 . $cmd
 

defaultenv-2/base/bin/ifup if [ "$ip" = static ]; then · line 57

Quoted 5 lines
defaultenv-2/base/bin/ifup +2 -0
@@ -51,6 +53,8 @@ if [ "$ip" = static ]; then
 	${interface}.netmask=$netmask
 	${interface}.serverip=$serverip
 	${interface}.gateway=$gateway
+	${interface}.nameserver0=$nameserver0
+	${interface}.nameserver1=$nameserver1

and this is not interface specific net.nameserver

and dhcp??
Best Regards,
J.

Quoted 26 lines
defaultenv-2/base/bin/ifup +0 -0
 	ret=0
 elif [ "$ip" = dhcp ]; then
 	dhcp
defaultenv-2/base/network/eth0 +2 -0
index 7e731ca..2ed64ca 100644
@@ -9,6 +9,8 @@ ipaddr=
 netmask=
 gateway=
 serverip=
+nameserver0=
+nameserver1=
 
 # MAC address if needed
 #ethaddr=xx:xx:xx:xx:xx:xx
Signature · 9 lines
1.7.2.5




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

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

#2 lore raw

Hi Jean-Christophe

Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD

defaultenv-2/base/bin/bootargs-ip line 12

Quoted 10 lines · Christoph Fritz
defaultenv-2/base/bin/bootargs-ip +3 -1
@@ -7,5 +7,7 @@
 if [ $ip = dhcp ]; then
 	global.linux.bootargs.dyn.ip="ip=dhcp"
 else
-	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0:"
+	global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0::"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver0:"
+	global.linux.bootargs.dyn.ip="$global.linux.bootargs.dyn.ip$eth0.nameserver1"

keep it on one line for grepping

ok

Quoted 22 lines
Quoted 14 lines
defaultenv-2/base/bin/ifup +2 -0
index 37b986c..fe5a242 100644
@@ -26,6 +26,8 @@ netmask=
 gateway=
 serverip=
 ethaddr=
+nameserver0=
+nameserver1=
 
 . $cmd
 

defaultenv-2/base/bin/ifup if [ "$ip" = static ]; then · line 57

Quoted 5 lines
defaultenv-2/base/bin/ifup +2 -0
@@ -51,6 +53,8 @@ if [ "$ip" = static ]; then
 	${interface}.netmask=$netmask
 	${interface}.serverip=$serverip
 	${interface}.gateway=$gateway
+	${interface}.nameserver0=$nameserver0
+	${interface}.nameserver1=$nameserver1

and this is not interface specific net.nameserver

Quoted 1 line

and dhcp??

When kernel-parameter "ip=dhcp" you can't set stuff like netmask, ip, or nameservers.

As stated in the commit message, due to current lack of a env-2 testing environment, I'm not sure how to implement the following snippet from env-1 in env-2:

defaultenv/bin/boot +1 -1
index 4e2056e..61287d5 100644
@@ -61,7 +61,7 @@ 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:$eth0.netmask::eth0::$net.nameserver0:$net.nameserver1"
 fi
 
 
defaultenv/config +2 -0
index 391ba47..38fab40 100644
@@ -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
++#net.nameserver0=a.b.c.d
++#net.nameserver1=a.b.c.d
 
 # can be either 'tftp', 'nfs', 'nand', 'nor' or 'disk'
 kernel_loc=tftp
Signature · 7 lines
Thanks,
 -- Christoph

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