3 @@ -362,6 +362,29 @@ static inline void setup_nr_cpu_ids(void
4 static inline void smp_prepare_cpus(unsigned int maxcpus) { }
7 +#ifdef CONFIG_MANGLE_BOOTARGS
8 +static void __init mangle_bootargs(char *command_line)
13 + rootdev = strstr(command_line, "root=/dev/mtdblock");
16 + strncpy(rootdev, "mangled_rootblock=", 18);
18 + rootfs = strstr(command_line, "rootfstype");
21 + strncpy(rootfs, "mangled_fs", 10);
25 +static void __init mangle_bootargs(char *command_line)
31 * We need to store the untouched command line for future reference.
32 * We also need to store the touched command line since the parameter
33 @@ -530,6 +553,7 @@ asmlinkage __visible void __init start_k
34 pr_notice("%s", linux_banner);
35 setup_arch(&command_line);
36 mm_init_cpumask(&init_mm);
37 + mangle_bootargs(command_line);
38 setup_command_line(command_line);
40 setup_per_cpu_areas();
43 @@ -1597,6 +1597,15 @@ config EMBEDDED
44 an embedded system so certain expert options are available
47 +config MANGLE_BOOTARGS
48 + bool "Rename offending bootargs"
51 + Sometimes the bootloader passed bogus root= and rootfstype=
52 + parameters to the kernel, and while you want to ignore them,
53 + you need to know the values f.e. to support dual firmware
54 + layouts on the flash.
56 config HAVE_PERF_EVENTS