3 @@ -368,6 +368,26 @@ static void __init setup_command_line(ch
4 strcpy(static_command_line, command_line);
7 +#ifdef CONFIG_MANGLE_BOOTARGS
8 +static void __init mangle_bootargs(char *command_line)
13 + rootdev = strstr(command_line, "root=/dev/mtdblock");
14 + strncpy(rootdev, "mangled_rootblock=", 18);
16 + rootfs = strstr(command_line, "rootfstype");
17 + strncpy(rootfs, "mangled_fs", 10);
21 +static void __init mangle_bootargs(char *command_line)
28 * We need to finalize in a non-__init function or else race conditions
29 * between the root thread and the init thread may cause start_kernel to
30 @@ -519,6 +539,7 @@ asmlinkage __visible void __init start_k
31 pr_notice("%s", linux_banner);
32 setup_arch(&command_line);
33 mm_init_cpumask(&init_mm);
34 + mangle_bootargs(command_line);
35 setup_command_line(command_line);
37 setup_per_cpu_areas();
40 @@ -1583,6 +1583,15 @@ config EMBEDDED
41 an embedded system so certain expert options are available
44 +config MANGLE_BOOTARGS
45 + bool "Rename offending bootargs"
48 + Sometimes the bootloader passed bogus root= and rootfstype=
49 + parameters to the kernel, and while you want to ignore them,
50 + you need to know the values f.e. to support dual firmware
51 + layouts on the flash.
53 config HAVE_PERF_EVENTS