1 --- a/arch/mips/kernel/setup.c
2 +++ b/arch/mips/kernel/setup.c
3 @@ -546,8 +546,28 @@ static void __init resource_init(void)
7 +#ifdef CONFIG_IMAGE_CMDLINE_HACK
8 +static void __init process__image_cmdline(void)
10 + extern char __image_cmdline[];
12 + if (__image_cmdline[0] == '\0')
15 + if (__image_cmdline[0] == '-') {
16 + strlcpy(arcs_cmdline, __image_cmdline, sizeof(arcs_cmdline));
18 + strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
19 + strlcat(arcs_cmdline, __image_cmdline, sizeof(arcs_cmdline));
23 +static void inline process__image_cmdline(void) {}
26 void __init setup_arch(char **cmdline_p)
28 + process__image_cmdline();
32 --- a/arch/mips/Kconfig
33 +++ b/arch/mips/Kconfig
34 @@ -806,6 +806,10 @@ config SYNC_R4K
38 +config IMAGE_CMDLINE_HACK
39 + bool "OpenWrt specific image command line hack"
45 --- a/arch/mips/kernel/head.S
46 +++ b/arch/mips/kernel/head.S
47 @@ -143,6 +143,12 @@ FEXPORT(__kernel_entry)
51 +#ifdef CONFIG_IMAGE_CMDLINE_HACK
53 +EXPORT(__image_cmdline)
55 +#endif /* CONFIG_IMAGE_CMDLINE_HACK */
59 NESTED(kernel_entry, 16, sp) # kernel entry point