summaryrefslogtreecommitdiffstats
path: root/common/oftree.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-04-29 20:13:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-14 09:16:31 +0200
commitee4cab9e587442f95e4fb3442355ca1eb56d9495 (patch)
tree5ef83d351e929e8970171dda175b7c1ae9bb49e6 /common/oftree.c
parentb8c94a15611ce7e191d022a3cd9f3ba23930a9c8 (diff)
downloadbarebox-ee4cab9e587442f95e4fb3442355ca1eb56d9495.tar.gz
barebox-ee4cab9e587442f95e4fb3442355ca1eb56d9495.tar.xz
booting: more flexible Linux bootargs generation
We currently use the environment variable 'bootargs' to get the Linux bootargs. This patch allows for a more flexible bootargs generation using global variables. With it the Linux bootargs are concatenated from multiple variables. This allows to replace parts of the bootargs string without having to reconstruct it completely. With this bootargs can be constructed like: global linux.bootargs.base="console=ttyS0,115200" global linux.bootargs.ip="ip=dhcp" global linux.mtdparts="physmap-flash.0:512K(nor0.barebox),-(root)" This will then automatically be combined into a kernel bootargs string during boot. If the 'linux.bootargs.' variables are all empty the old standard 'bootargs' way will be used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/oftree.c')
-rw-r--r--common/oftree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/oftree.c b/common/oftree.c
index a657d31664..49758a9ddf 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -11,6 +11,7 @@
#include <errno.h>
#include <getopt.h>
#include <init.h>
+#include <boot.h>
#define MAX_LEVEL 32 /* how deeply nested we will go */
@@ -257,7 +258,7 @@ static int of_fixup_bootargs(struct fdt_header *fdt)
if (nodeoffset < 0)
return nodeoffset;
- str = getenv("bootargs");
+ str = linux_bootargs_get();
if (str) {
err = fdt_setprop(fdt, nodeoffset,
"bootargs", str, strlen(str)+1);