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>
This commit is contained in:
parent
d3f4ae5614
commit
f52cf03aad
|
@ -38,7 +38,7 @@ static int linux_bootargs_overwritten;
|
||||||
*/
|
*/
|
||||||
const char *linux_bootargs_get(void)
|
const char *linux_bootargs_get(void)
|
||||||
{
|
{
|
||||||
char *bootargs, *mtdparts;
|
char *bootargs, *parts;
|
||||||
|
|
||||||
if (linux_bootargs_overwritten)
|
if (linux_bootargs_overwritten)
|
||||||
return linux_bootargs;
|
return linux_bootargs;
|
||||||
|
@ -49,14 +49,21 @@ const char *linux_bootargs_get(void)
|
||||||
if (!strlen(bootargs))
|
if (!strlen(bootargs))
|
||||||
return getenv("bootargs");
|
return getenv("bootargs");
|
||||||
|
|
||||||
mtdparts = globalvar_get_match("linux.mtdparts.", ";");
|
linux_bootargs = bootargs;
|
||||||
|
|
||||||
if (strlen(mtdparts)) {
|
parts = globalvar_get_match("linux.mtdparts.", ";");
|
||||||
linux_bootargs = asprintf("%s mtdparts=%s", bootargs, mtdparts);
|
if (strlen(parts)) {
|
||||||
free(bootargs);
|
bootargs = asprintf("%s mtdparts=%s", linux_bootargs, parts);
|
||||||
free(mtdparts);
|
free(linux_bootargs);
|
||||||
} else {
|
free(parts);
|
||||||
free(mtdparts);
|
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;
|
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_bootargs_, global.linux.bootargs.*, "Linux bootargs variables");
|
||||||
BAREBOX_MAGICVAR_NAMED(global_linux_mtdparts_, global.linux.mtdparts.*, "Linux mtdparts 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");
|
||||||
|
|
Loading…
Reference in New Issue