diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-29 20:13:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-14 09:16:31 +0200 |
commit | ee4cab9e587442f95e4fb3442355ca1eb56d9495 (patch) | |
tree | 5ef83d351e929e8970171dda175b7c1ae9bb49e6 /commands | |
parent | b8c94a15611ce7e191d022a3cd9f3ba23930a9c8 (diff) | |
download | barebox-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 'commands')
-rw-r--r-- | commands/Kconfig | 12 | ||||
-rw-r--r-- | commands/linux16.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/commands/Kconfig b/commands/Kconfig index 1c152948c1..1839538dde 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -396,6 +396,18 @@ config CMD_BOOTU compile in the 'bootu' command to start raw (uncompressed) Linux images +config FLEXIBLE_BOOTARGS + bool + prompt "flexible Linux bootargs generation" + depends on CMD_GLOBAL + help + Select this to get a more flexible bootargs generation. With this + option the bootargs are concatenated together from global variables + beginning with 'global.linux.bootargs.' and 'global.linux.mtdparts.' + This allows for more flexible scripting since with it it's possible + to replace parts of the bootargs string without reconstructing it + completely + config CMD_LINUX16 tristate depends on X86 diff --git a/commands/linux16.c b/commands/linux16.c index 20413b6f0d..eccafa8b57 100644 --- a/commands/linux16.c +++ b/commands/linux16.c @@ -162,7 +162,7 @@ static int do_linux16(int argc, char *argv[]) unsigned real_mode_size; int vid_mode = NORMAL_VGA; size_t image_size; - const char *cmdline = getenv("bootargs"); + const char *cmdline = linux_bootargs_get(); const char *kernel_file; while((opt = getopt(argc, argv, "v:")) > 0) { |