d72073dfbbf54073774e9342a2e90f833af5936c
[lede.git] / target / linux / adm5120-2.6 / patches / 140-cmdline_hack.patch
1 diff -ur linux.old/arch/mips/kernel/head.S linux.dev/arch/mips/kernel/head.S
2 --- linux.old/arch/mips/kernel/head.S   2006-12-06 17:30:27.000000000 +0100
3 +++ linux.dev/arch/mips/kernel/head.S   2006-12-06 18:34:43.000000000 +0100
4 @@ -129,15 +129,20 @@
5  #endif
6         .endm
7  
8 -
9         j kernel_entry
10         nop
11 -
12 +       nop
13 +       
14         /*
15          * Reserved space for exception handlers.
16          * Necessary for machines which link their kernels at KSEG0.
17 +        * Use as temporary storage for the kernel command line, so that it
18 +        * can be updated easily without having to relink the kernel.
19          */
20 -       .fill   0x400
21 +        
22 +EXPORT(_image_cmdline)
23 +       .ascii "CMDLINE:"
24 +       .fill   0x3ec
25  
26  EXPORT(stext)                                  # used for profiling
27  EXPORT(_stext)
28 diff -ur linux.old/arch/mips/adm5120/prom.c linux.dev/arch/mips/adm5120/prom.c
29 --- linux.old/arch/mips/adm5120/prom.c  2006-12-06 17:30:27.000000000 +0100
30 +++ linux.dev/arch/mips/adm5120/prom.c  2006-12-06 17:41:40.000000000 +0100
31 @@ -100,6 +100,7 @@
32  }
33  
34  
35 +extern char _image_cmdline;
36  /*
37   * initialize the prom module.
38   */
39 @@ -112,8 +112,10 @@
40         mips_machtype = adm5120_board.mach_type;
41  
42         /* init command line, register a default kernel command line */
43 -       strcpy(&(arcs_cmdline[0]), CONFIG_CMDLINE);
44 +       char *cmd = &_image_cmdline + 8;
45 +       if( strlen(cmd) > 0) strcpy( &(arcs_cmdline[0]), cmd);
46 +               else strcpy(&(arcs_cmdline[0]), CONFIG_CMDLINE);
47  
48         /* init memory map */
49         prom_meminit();
50  }