X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fgeneric%2Fpatches-3.18%2F995-mangle_bootargs.patch;h=0029e9082284dac74343667fe1de9f76a85a4c06;hb=9a59b350b7587eae4bcf6091b4dc86a4ee92bcf6;hp=5d56cf44626fe2d70b0a03f748c14e220e8a900b;hpb=17fb965d6baadc0ac6d39e7cb89954722f2ea7d2;p=openwrt%2Fopenwrt.git diff --git a/target/linux/generic/patches-3.18/995-mangle_bootargs.patch b/target/linux/generic/patches-3.18/995-mangle_bootargs.patch index 5d56cf4462..0029e90822 100644 --- a/target/linux/generic/patches-3.18/995-mangle_bootargs.patch +++ b/target/linux/generic/patches-3.18/995-mangle_bootargs.patch @@ -1,8 +1,8 @@ --- a/init/main.c +++ b/init/main.c -@@ -379,6 +379,26 @@ static void __init setup_command_line(ch - strcpy(static_command_line, command_line); - } +@@ -362,6 +362,29 @@ static inline void setup_nr_cpu_ids(void + static inline void smp_prepare_cpus(unsigned int maxcpus) { } + #endif +#ifdef CONFIG_MANGLE_BOOTARGS +static void __init mangle_bootargs(char *command_line) @@ -11,10 +11,14 @@ + char *rootfs; + + rootdev = strstr(command_line, "root=/dev/mtdblock"); -+ strncpy(rootdev, "mangled_rootblock=", 18); ++ ++ if (rootdev) ++ strncpy(rootdev, "mangled_rootblock=", 18); + + rootfs = strstr(command_line, "rootfstype"); -+ strncpy(rootfs, "mangled_fs", 10); ++ ++ if (rootfs) ++ strncpy(rootfs, "mangled_fs", 10); + +} +#else @@ -22,12 +26,11 @@ +{ +} +#endif -+ + /* - * We need to finalize in a non-__init function or else race conditions - * between the root thread and the init thread may cause start_kernel to -@@ -530,6 +550,7 @@ asmlinkage __visible void __init start_k + * We need to store the untouched command line for future reference. + * We also need to store the touched command line since the parameter +@@ -530,6 +553,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm);