summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/Kconfig1
-rw-r--r--defaultenv/defaultenv-2-base/boot/net8
2 files changed, 8 insertions, 1 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 1c2669084a..b522a86ad4 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -867,6 +867,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW
select CMD_BOOT
select NET_CMD_IFUP if NET
select CMD_IP_ROUTE_GET if NET
+ select CMD_HOST if NET
config DEFAULT_ENVIRONMENT_GENERIC
bool "Generic environment template (old version)"
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index 840e9fc1f0..f8895290ad 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