Re: [PATCH 1/1] 2.6.14-rc3 x86: COMMAND_LINE_SIZE

Alon Bar-Lev
2005-10-11T18:15:04Z

Georg Lippold wrote:
> Alon Bar-Lev wrote:
>
>>But the address of cmd_line_ptr is defined to be from the end of the
>>setup to 0xa0000. This is well defined, since the boot loader will
>>load the kernel, initramfs and cmd_line_ptr to the correct place...
>>Nothing is overwritten... Then the kernel is up and takes as much as
>>it needs from cmd_line_ptr.
>
>
> OK, then: Update my patch if you want to and resubmit it. I would like
> to get this through as quickly as possible.
>
> Greetings,
>
> Georg
>

OK...
Here it goes...
I don't have git...
I hope it is enough...

diff -urNp linux-2.6.13.4.org/Documentation/i386/boot.txt
linux-2.6.13.4/Documentation/i386/boot.txt
--- linux-2.6.13.4.org/Documentation/i386/boot.txt
2005-10-10 20:54:29.000000000 +0200
+++ linux-2.6.13.4/Documentation/i386/boot.txt 2005-10-11
19:01:40.000000000 +0200
@@ -230,12 +230,13 @@ loader to communicate with the kernel.
relevant to the boot loader itself, see "special command
line options"
below.

-The kernel command line is a null-terminated string up to 255
-characters long, plus the final null.
+If the boot protocol version is 2.01 or older, the kernel
command line is
+a null-terminated string up to 255 characters long, plus
the final null.

If the boot protocol version is 2.02 or later, the address
of the
kernel command line is given by the header field
cmd_line_ptr (see
-above.)
+above.), the kernel may truncate this string if it is too long
+for handle.

If the protocol version is *not* 2.02 or higher, the kernel
command line is entered using the following protocol:
diff -urNp linux-2.6.13.4.org/include/asm-i386/param.h
linux-2.6.13.4/include/asm-i386/param.h
--- linux-2.6.13.4.org/include/asm-i386/param.h 2005-10-10
20:54:29.000000000 +0200
+++ linux-2.6.13.4/include/asm-i386/param.h 2005-10-11
19:08:42.000000000 +0200
@@ -20,6 +20,5 @@
#endif

#define MAXHOSTNAMELEN 64 /* max length of hostname */
-#define COMMAND_LINE_SIZE 256

#endif
diff -urNp linux-2.6.13.4.org/include/asm-i386/setup.h
linux-2.6.13.4/include/asm-i386/setup.h
--- linux-2.6.13.4.org/include/asm-i386/setup.h 2005-10-10
20:54:29.000000000 +0200
+++ linux-2.6.13.4/include/asm-i386/setup.h 2005-10-11
19:10:46.000000000 +0200
@@ -17,7 +17,10 @@
#define MAX_NONPAE_PFN (1 << 20)

#define PARAM_SIZE 4096
-#define COMMAND_LINE_SIZE 256
+
+#ifdef CONFIG_COMMAND_LINE_MAX_SIZE
+#define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE_MAX_SIZE
+#endif

#define OLD_CL_MAGIC_ADDR 0x90020
#define OLD_CL_MAGIC 0xA33F
diff -urNp linux-2.6.13.4.org/include/asm-x86_64/setup.h
linux-2.6.13.4/include/asm-x86_64/setup.h
--- linux-2.6.13.4.org/include/asm-x86_64/setup.h 2005-10-10
20:54:29.000000000 +0200
+++ linux-2.6.13.4/include/asm-x86_64/setup.h 2005-10-11
19:21:18.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _x8664_SETUP_H
#define _x8664_SETUP_H

-#define COMMAND_LINE_SIZE 256
+#ifdef CONFIG_COMMAND_LINE_MAX_SIZE
+#define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE_MAX_SIZE
+#endif

#endif
diff -urNp linux-2.6.13.4.org/init/Kconfig
linux-2.6.13.4/init/Kconfig
--- linux-2.6.13.4.org/init/Kconfig 2005-10-10
20:54:29.000000000 +0200
+++ linux-2.6.13.4/init/Kconfig 2005-10-11
19:20:23.000000000 +0200
@@ -77,6 +77,13 @@ config LOCALVERSION
object and source tree, in that order. Your total
string can
be a maximum of 64 characters.

+config COMMAND_LINE_MAX_SIZE
+ int "Maximum kernel command-line size"
+ default 512
+ help
+ This option allows you to specify maximum kernel
command-line
+ for kernel to handle.
+
config SWAP
bool "Support for paging of anonymous memory (swap)"
depends on MMU