--- zzzz-none-000/linux-5.4.213/init/main.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/init/main.c 2024-08-14 09:02:11.000000000 +0000 @@ -367,6 +367,29 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif +#ifdef CONFIG_MANGLE_BOOTARGS +static void __init mangle_bootargs(char *command_line) +{ + char *rootdev; + char *rootfs; + + rootdev = strstr(command_line, "root=/dev/mtdblock"); + + if (rootdev) + strncpy(rootdev, "mangled_rootblock=", 18); + + rootfs = strstr(command_line, "rootfstype"); + + if (rootfs) + strncpy(rootfs, "mangled_fs", 10); + +} +#else +static void __init mangle_bootargs(char *command_line) +{ +} +#endif + /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter @@ -561,6 +584,7 @@ kmemleak_init(); pgtable_init(); debug_objects_mem_init(); + debug_mem_usage_init(); vmalloc_init(); ioremap_huge_init(); /* Should be run before the first non-init thread is created */ @@ -597,6 +621,7 @@ pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); + mangle_bootargs(command_line); setup_command_line(command_line); setup_nr_cpu_ids(); setup_per_cpu_areas();