summaryrefslogtreecommitdiffstats
path: root/defaultenv
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-11-28 12:55:42 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-12-15 08:12:30 +0100
commit8201a940e313cd9c2f989a7af5d6a4fb3f8ab31c (patch)
treec37c9162728b7ec67f045f27d5f17fa1904d3976 /defaultenv
parent183515b67a757d51f538af3dc6dcd2c889ddd3af (diff)
downloadbarebox-8201a940e313cd9c2f989a7af5d6a4fb3f8ab31c.tar.gz
defaultenv-2: set bootargs correctly for network boot
The defaultenv-2 network boot script uses bootargs-ip which hardcodes eth0 as network device. To make this work with other nwetork devices use the "ip_route_get" command to determine the network device used to reach the server. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/defaultenv-2-base/bin/bootargs-ip11
-rw-r--r--defaultenv/defaultenv-2-base/boot/net3
2 files changed, 2 insertions, 12 deletions
diff --git a/defaultenv/defaultenv-2-base/bin/bootargs-ip b/defaultenv/defaultenv-2-base/bin/bootargs-ip
deleted file mode 100644
index 2d4486c..0000000
--- a/defaultenv/defaultenv-2-base/bin/bootargs-ip
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# pass either static ip or dhcp to kernel based on barebox settings
-
-. /env/network/eth0
-
-if [ $ip = dhcp ]; then
- global.linux.bootargs.dyn.ip="ip=dhcp"
-else
- global.linux.bootargs.dyn.ip="ip=$ipaddr:$serverip:$gateway:$netmask::eth0:"
-fi
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index af09641..aaa5394 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -10,7 +10,8 @@ if [ -f "${oftree}" ]; then
fi
nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
-bootargs-ip
+
+ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
initramfs="${path}/${global.user}-initramfs-${global.hostname}"
if [ -f "${initramfs}" ]; then