summaryrefslogtreecommitdiffstats
path: root/defaultenv
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-01-04 16:18:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-07 08:30:56 +0100
commit834e686df4b3a7733c4c3e6fc5d4cce73549f7f5 (patch)
treee41374247458c4326aa71d2740a6e3860d8a01a3 /defaultenv
parent1f21a63e5fedf3be7e7035bfae15bab8a5dc07f4 (diff)
downloadbarebox-834e686df4b3a7733c4c3e6fc5d4cce73549f7f5.tar.gz
defaultenv: resolve global.net.server before using it
global.net.server may contain a hostname, so we have to resolve it before using it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/defaultenv-2-base/boot/net8
1 files changed, 7 insertions, 1 deletions
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index 840e9fc..f889529 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -9,7 +9,13 @@ if [ -f "${oftree}" ]; then
global.bootm.oftree="$oftree"
fi
-nfsroot="${global.net.server}:/home/${global.user}/nfsroot/${global.hostname}"
+host ${global.net.server} nfsserver
+if [ $? != 0 ]; then
+ echo "Cannot resolve \"${global.net.server}\""
+ exit 1
+fi
+
+nfsroot="${nfsserver}:/home/${global.user}/nfsroot/${global.hostname}"
ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip