summaryrefslogtreecommitdiffstats
path: root/defaultenv-2
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-09-25 17:51:16 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-30 07:45:31 +0200
commitf7c132fa4c271eeea800ec9228a81b6fb5bcc0c6 (patch)
treef7e52bb0175e0b0c282ee323d4270c4bf856eafd /defaultenv-2
parentac6d9243013ac5cb08d87e0715c5234cca248401 (diff)
downloadbarebox-f7c132fa4c271eeea800ec9228a81b6fb5bcc0c6.tar.gz
barebox-f7c132fa4c271eeea800ec9228a81b6fb5bcc0c6.tar.xz
defenv-2: Do not overwrite previously existing global variables
In case board code has already initialized global variables during init do not overwrite them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv-2')
-rw-r--r--defaultenv-2/base/bin/init19
1 files changed, 13 insertions, 6 deletions
diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index ca02ba6427..996fea7e87 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -2,16 +2,23 @@
export PATH=/env/bin
-global hostname=generic
-global user=none
-global autoboot_timeout=3
-global boot.default=net
-global allow_color=true
+global hostname
+global user
+global autoboot_timeout
+global boot.default
+global allow_color
global linux.bootargs.base
#linux.bootargs.dyn.* will be cleared at the beginning of boot
global linux.bootargs.dyn.ip
global linux.bootargs.dyn.root
-global editcmd=sedit
+global editcmd
+
+[ -z "${global.hostname}" ] && global.hostname=generic
+[ -z "${global.user}" ] && global.user=none
+[ -z "${global.autoboot_timeout}" ] && global.autoboot_timeout=3
+[ -z "${global.boot.default}" ] && global.boot.default=net
+[ -z "${global.allow_color}" ] && global.allow_color=true
+[ -z "${global.editcmd}" ] && global.editcmd=sedit
[ -e /env/config-board ] && /env/config-board
/env/config