From 1f21a63e5fedf3be7e7035bfae15bab8a5dc07f4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 4 Jan 2019 16:16:21 +0100 Subject: defaultenv: defaultenv uses ip_route_get The default environment uses the ip_route_get command, so select it when networking is enabled. Signed-off-by: Sascha Hauer --- common/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'common/Kconfig') diff --git a/common/Kconfig b/common/Kconfig index 2ad92158c1..1c2669084a 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -866,6 +866,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW select FLEXIBLE_BOOTARGS select CMD_BOOT select NET_CMD_IFUP if NET + select CMD_IP_ROUTE_GET if NET config DEFAULT_ENVIRONMENT_GENERIC bool "Generic environment template (old version)" -- cgit v1.2.3 From 834e686df4b3a7733c4c3e6fc5d4cce73549f7f5 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 4 Jan 2019 16:18:25 +0100 Subject: 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 --- common/Kconfig | 1 + defaultenv/defaultenv-2-base/boot/net | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'common/Kconfig') 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 -- cgit v1.2.3