summaryrefslogtreecommitdiffstats
path: root/common/bootargs.c
diff options
context:
space:
mode:
authorHubert Feurstein <hubert.feurstein@deto.at>2015-02-16 14:03:18 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-17 08:46:36 +0100
commitf52cf03aad13b49c6ff756610e7d3a777e8ee15e (patch)
tree2b1979013592b90128e098430d947475ad3d9f1b /common/bootargs.c
parentd3f4ae5614c4d5beeb5f469102a181af1cef70f7 (diff)
downloadbarebox-f52cf03aad13b49c6ff756610e7d3a777e8ee15e.tar.gz
common/bootargs: add blkdevparts variables
The kernel command line option blkdevparts works like mtdparts, but for all block devices. So it can be used for eMMC devices without the need of a traditional partition table. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bootargs.c')
-rw-r--r--common/bootargs.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/common/bootargs.c b/common/bootargs.c
index 6624f72..803736f 100644
--- a/common/bootargs.c
+++ b/common/bootargs.c
@@ -38,7 +38,7 @@ static int linux_bootargs_overwritten;
*/
const char *linux_bootargs_get(void)
{
- char *bootargs, *mtdparts;
+ char *bootargs, *parts;
if (linux_bootargs_overwritten)
return linux_bootargs;
@@ -49,14 +49,21 @@ const char *linux_bootargs_get(void)
if (!strlen(bootargs))
return getenv("bootargs");
- mtdparts = globalvar_get_match("linux.mtdparts.", ";");
+ linux_bootargs = bootargs;
- if (strlen(mtdparts)) {
- linux_bootargs = asprintf("%s mtdparts=%s", bootargs, mtdparts);
- free(bootargs);
- free(mtdparts);
- } else {
- free(mtdparts);
+ parts = globalvar_get_match("linux.mtdparts.", ";");
+ if (strlen(parts)) {
+ bootargs = asprintf("%s mtdparts=%s", linux_bootargs, parts);
+ free(linux_bootargs);
+ free(parts);
+ linux_bootargs = bootargs;
+ }
+
+ parts = globalvar_get_match("linux.blkdevparts.", ";");
+ if (strlen(parts)) {
+ bootargs = asprintf("%s blkdevparts=%s", linux_bootargs, parts);
+ free(linux_bootargs);
+ free(parts);
linux_bootargs = bootargs;
}
@@ -78,3 +85,4 @@ int linux_bootargs_overwrite(const char *bootargs)
BAREBOX_MAGICVAR_NAMED(global_linux_bootargs_, global.linux.bootargs.*, "Linux bootargs variables");
BAREBOX_MAGICVAR_NAMED(global_linux_mtdparts_, global.linux.mtdparts.*, "Linux mtdparts variables");
+BAREBOX_MAGICVAR_NAMED(global_linux_blkdevparts_, global.linux.blkdevparts.*, "Linux blkdevparts variables");