diff -ru linux-2.4.20.old/arch/i386/config.in linux/arch/i386/config.in --- linux-2.4.20.old/arch/i386/config.in 2003-03-04 10:58:05.000000000 +0100 +++ linux/arch/i386/config.in 2003-03-04 11:19:27.000000000 +0100 @@ -316,6 +316,12 @@ bool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF fi +bool 'Hardcoded kernel command line' CONFIG_CMDLINE_ENABLE +if [ "$CONFIG_CMDLINE_ENABLE" = "y" ]; then + bool ' Bootloader overrides hardcoded' CONFIG_CMDLINE_OVERRIDE + string ' Initial kernel command line' CONFIG_CMDLINE "root=301 ro" +fi + endmenu source drivers/mtd/Config.in diff -ru linux-2.4.20.old/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c --- linux-2.4.20.old/arch/i386/kernel/setup.c 2003-03-04 10:59:15.000000000 +0100 +++ linux/arch/i386/kernel/setup.c 2003-03-04 11:02:27.000000000 +0100 @@ -737,10 +737,19 @@ int len = 0; int userdef = 0; +#ifdef CONFIG_CMDLINE_ENABLE + int cmdline_hardcode_flag = 1; + #ifdef CONFIG_CMDLINE_OVERRIDE + if (*from) cmdline_hardcode_flag = 0; + #endif + if (cmdline_hardcode_flag) from= CONFIG_CMDLINE; +#endif + /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + memcpy(saved_command_line, from, COMMAND_LINE_SIZE); saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + for (;;) { if (c != ' ') goto nextchar; diff -ru linux-2.4.20.old/arch/x86_64/config.in linux/arch/x86_64/config.in --- linux-2.4.20.old/arch/x86_64/config.in 2003-03-04 10:58:15.000000000 +0100 +++ linux/arch/x86_64/config.in 2003-03-04 11:21:01.000000000 +0100 @@ -118,6 +118,12 @@ fi fi +bool 'Hardcoded kernel command line' CONFIG_CMDLINE_ENABLE +if [ "$CONFIG_CMDLINE_ENABLE" = "y" ]; then + bool ' Bootloader overrides hardcoded' CONFIG_CMDLINE_OVERRIDE + string ' Initial kernel command line' CONFIG_CMDLINE "root=301 ro" +fi + endmenu source drivers/mtd/Config.in diff -ru linux-2.4.20.old/arch/x86_64/kernel/e820.c linux/arch/x86_64/kernel/e820.c --- linux-2.4.20.old/arch/x86_64/kernel/e820.c 2003-03-04 10:58:44.000000000 +0100 +++ linux/arch/x86_64/kernel/e820.c 2003-03-04 10:57:41.000000000 +0100 @@ -483,8 +483,16 @@ int len = 0; int usermem = 0; +#ifdef CONFIG_CMDLINE_ENABLE + int cmdline_hardcode_flag = 1; + #ifdef CONFIG_CMDLINE_OVERRIDE + if (*from) cmdline_hardcode_flag = 0; + #endif + if (cmdline_hardcode_flag) from= CONFIG_CMDLINE; +#endif + /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + memcpy(saved_command_line, from, COMMAND_LINE_SIZE); saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { diff -ru linux-2.4.20.old/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.4.20.old/Documentation/Configure.help 2003-03-04 10:55:32.000000000 +0100 +++ linux/Documentation/Configure.help 2003-03-04 11:21:09.000000000 +0100 @@ -24033,6 +24033,24 @@ You can also say M here to compile this support as a module (which will be called arthur.o). +Hardcoded kernel command line +CONFIG_CMDLINE_ENABLE + When you create a kernel for booting directly from a floppy, or you + don't trust the command line provided by the bootloader for security + reasons, you can add support for a hardcoded command line by saying Y. + Most times you won't need this, say N. + +Bootloader overrides hardcoded +CONFIG_CMDLINE_OVERRIDE + If you specify a hardcoded kernel command line, but you want to use + the same kernel with your favorite bootmanager (p.e. LILO), + the bootloader can set its own command line, this way overriding + the internal hardcoded one, if set to Y, + If you set this to N the bootloaders command line will just + be ignored and the hardcoded command line will be used instead. + This might be important doe to security reasons. + Most times it's better to say Y. + Initial kernel command line CONFIG_CMDLINE On some architectures (EBSA110 and CATS), there is currently no way @@ -24040,6 +24058,8 @@ architectures, you should supply some command-line options at build time by entering them here. As a minimum, you should specify the memory size and the root device (e.g., mem=64M root=/dev/nfs). + This item has been added to i386 and x64-64, + as an optional feature, too. Kernel-mode alignment trap handler CONFIG_ALIGNMENT_TRAP