Make MAX_INIT_ARGS 25
Hello, everyone:
We at Red Hat shipped a larger number of arguments for quite some time, it was required for installations on IBM mainframe (s390), which doesn't have a good way to pass arguments. I tried to submit it before, but only half-heartedly, because I saw it as not benefitting folks at large, so why bloat, right?
I really hate carrying divergent patches in Red Hat tree, even small ones like this one, but there wasn't enough pull to integrate. Recently I saw patches which try to make the MAX_INIT_ARGS and MAX_INIT_ENVS configurable. Apparently, it's needed for someone else besides mainframe now. This is an example (from Mike McLean):
Quoted 5 lines
There are a number of reasonable situations that go past the current limits of 8. One that comes to mind is when you want to perform a manual vnc install on a headless machine using anaconda. This requires passing in a number of parameters to get anaconda past the initial (no-gui) loader screens.
I thought about it and decided that making this configurable is more trouble than it's worth. We'd need a new entry, all to save a few words. There would be a need to document it, and to ask users "are you sure you configured your MAX_INIT_FOO to 20?" OTOH, if we just bump it, any software can just look at version and magically know if the kernel supports larger number of arguments, at the moment of kernel installation. Say, if Linus takes it now, 2.6.8 and above would be "ok for jumpstart".
I'd like to ask (Andrew? Linus?) simply to bump the value somewhat, without any complications. The value of 25 is specifically selected to show that it's arbitrary. Mike wanted 32, but that just looked too meaningful.
-- Pete
init/main.c +2 -2
@@ -102,8 +102,8 @@/* * Boot command-line arguments */ -#define MAX_INIT_ARGS 8 -#define MAX_INIT_ENVS 8 +#define MAX_INIT_ARGS 25 +#define MAX_INIT_ENVS 25extern void time_init (void );/* Default late time init is NULL. archs can override this later. */
init/main.c line 106
Quoted 10 lines · Pete Zaitcev
init/main.c +2
-2@@ -102,8 +102,8 @@/* * Boot command-line arguments */ -#define MAX_INIT_ARGS 8 -#define MAX_INIT_ENVS 8 +#define MAX_INIT_ARGS 25 +#define MAX_INIT_ENVS 25
You should also increase the COMMAND_LINE_SIZE.
Signature · 3 lines
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */
#define say(x) lie(x)init/main.c renamed from init/main.c.org +2 -2
@@ -103,8 +103,8 @@/* * Boot command-line arguments */ -#define MAX_INIT_ARGS 8 -#define MAX_INIT_ENVS 8 +#define MAX_INIT_ARGS 256 +#define MAX_INIT_ENVS 256extern void time_init (void );/* Default late time init is NULL. archs can override this later. */
include/asm-i386/param.h renamed from include/asm-i386/param.h.orig +1 -1
@@ -18,6 +18,6 @@#endif #define MAXHOSTNAMELEN 64/* max length of hostname */ -#define COMMAND_LINE_SIZE 256 +#define COMMAND_LINE_SIZE 4096#endif
include/asm-i386/setup.h +1 -1
@@ -17,7 +17,7 @@#define MAX_NONPAE_PFN (1 << 20)#define PARAM_SIZE 2048 -#define COMMAND_LINE_SIZE 256 +#define COMMAND_LINE_SIZE 4096#define OLD_CL_MAGIC_ADDR 0x90020#define OLD_CL_MAGIC 0xA33F
include/asm-s390/setup.h +1 -1
@@ -9,7 +9,7 @@#define _ASM_S390_SETUP_H#define PARMAREA 0x10400 -#define COMMAND_LINE_SIZE 896 +#define COMMAND_LINE_SIZE 4096#define RAMDISK_ORIGIN 0x800000#define RAMDISK_SIZE 0x800000
include/asm-ppc/setup.h renamed from include/asm-ppc/setup.h.orig +1 -1
@@ -8,7 +8,7 @@#include <asm-m68k/setup.h> /* We have a bigger command line buffer. */ #undef COMMAND_LINE_SIZE -#define COMMAND_LINE_SIZE 512 +#define COMMAND_LINE_SIZE 4096#endif /* _PPC_SETUP_H */ #endif /* __KERNEL__ */
arch/ppc/syslib/prom.c renamed from arch/ppc/syslib/prom.c.orig +1 -1
@@ -85,7 +85,7 @@extern void enter_rtas (void *);void phys_call_rtas (int ,int ,int , ...); -extern char cmd_line[512 ];/* XXX */ +extern char cmd_line[COMMAND_LINE_SIZE ];extern boot_infos_t *boot_infos;unsigned long dev_tree_size;
Quoted 6 lines · On Thu, 5 Aug 2004 07:52:46 +0200 Pawe__ Sikora <[email protected]> wrote:
init/main.c
Quoted 4 lines
init/main.c renamed from init/main.c.org +2
-2-#define MAX_INIT_ARGS 8 -#define MAX_INIT_ENVS 8 +#define MAX_INIT_ARGS 25 +#define MAX_INIT_ENVS 25You should also increase the
COMMAND_LINE_SIZE.
I'm not doing it because I have nothing better to do, but because we have a specific requirement. Our software works fine with the current maximum buffer size. If you have different requirement, please let me know what kind of situation it is in detail, it might help advocacy.
-- Pete
Quoted 1 line
You should also increase the
COMMAND_LINE_SIZE.
Unlike the generic settings in init/main.c of MAX_INIT_ARGS and MAX_INIT_ENV, the setting of COMMAND_LINE_SIZE is arch-specific, and on many arch's already set to an ample value such as 512, 896 or 1024.
If you have a specific arch for which this value is too small for your needs, you probably need to take that up with the maintainers of that arch code.
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373init/main.c line 106
Quoted 11 lines · Pete Zaitcev
init/main.c +2
-2@@ -102,8 +102,8 @@/* * Boot command-line arguments */ -#define MAX_INIT_ARGS 8 -#define MAX_INIT_ENVS 8 +#define MAX_INIT_ARGS 25 +#define MAX_INIT_ENVS 25
Why is there a limit anyway? Can the whole thing be dynamic? Any why panic if there are more than n options passed? Just ignore the remaining options?
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 1 line
Can the whole thing be dynamic?
We're a little short of dynamic memory allocation mechanisms this early in the boot, I'm afraid.
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373Quoted 4 lines · Paul Jackson
Quoted 1 line
Can the whole thing be dynamic?
We're a little short of dynamic memory allocation mechanisms this early in the boot, I'm afraid.
Ok, I'm fine with 32, we have such a patch since ages.
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 8 lines · On Thu, 5 Aug 2004 18:12:36 +0200 Olaf Hering <[email protected]> wrote:
Quoted 4 lines · Paul Jackson
Quoted 1 line
Can the whole thing be dynamic?
We're a little short of dynamic memory allocation mechanisms this early in the boot, I'm afraid.
Ok, I'm fine with 32, we have such a patch since ages.
I certainly don't mind 32, if SuSE software needs that. We shipped 25 for a while and everything worked on our side, so I wasn't aware. In actuality, Mike McLean's patch did establish 32, but then it looked like a knee-jerk power of 2 alignment, which we C hackers love irrationally :-)
-- Pete