mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Up silly limit on .config line length
@ 2002-11-05 23:38 Russell King
  2002-11-06 13:32 ` Roman Zippel
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King @ 2002-11-05 23:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: zippel

kconfig brought in a bug whereby no .config line can be longer than 128
characters.  This causes a problem since it is quite common to have
.config lines longer than this on ARM, especially when they contain the
default kernel command line, like:

CONFIG_CMDLINE="console=ttySA0,38400n8 cpufreq=221200 rw root=/dev/ram0 mtdparts=sa1100:512K(boot),1M(kernel),2560K(initrd),4M("

The effect of this bug can be seen above; in this case it has chopped
off the parameters that allow this machine to boot; the missing parameters
should be:

 "root) load_ramdisk=1 prompt_ramdisk=0 mem=32M noinitrd initrd=0xc0800000,3M"

I believe that this arbitary limit should be eliminated by some method.
However, as a "get you working" patch with a new arbitary limit of 1024
characters:

--- linux/scripts/kconfig/confdata.c	Tue Nov  5 23:24:42 2002
+++ linux-sa1100/scripts/kconfig/confdata.c	Tue Nov  5 23:28:57 2002
@@ -61,7 +61,7 @@
 int conf_read(const char *name)
 {
 	FILE *in = NULL;
-	char line[128];
+	char line[1024];
 	char *p, *p2;
 	int lineno = 0;
 	struct symbol *sym;
@@ -105,7 +105,7 @@
 		}
 	}
 
-	while (fgets(line, 128, in)) {
+	while (fgets(line, sizeof(line), in)) {
 		lineno++;
 		switch (line[0]) {
 		case '#':

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Up silly limit on .config line length
  2002-11-05 23:38 [PATCH] Up silly limit on .config line length Russell King
@ 2002-11-06 13:32 ` Roman Zippel
  2002-11-06 13:34   ` Russell King
  2002-11-06 21:32   ` Sam Ravnborg
  0 siblings, 2 replies; 4+ messages in thread
From: Roman Zippel @ 2002-11-06 13:32 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

Hi,

On Tue, 5 Nov 2002, Russell King wrote:

> I believe that this arbitary limit should be eliminated by some method.
> However, as a "get you working" patch with a new arbitary limit of 1024
> characters:

I was already wondering, how much I should allow. :)
But I'd rather set an arbitrary limit (and warn) than allowing an 
arbitrary long string.

bye, Roman


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Up silly limit on .config line length
  2002-11-06 13:32 ` Roman Zippel
@ 2002-11-06 13:34   ` Russell King
  2002-11-06 21:32   ` Sam Ravnborg
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King @ 2002-11-06 13:34 UTC (permalink / raw)
  To: Roman Zippel; +Cc: linux-kernel

On Wed, Nov 06, 2002 at 02:32:30PM +0100, Roman Zippel wrote:
> On Tue, 5 Nov 2002, Russell King wrote:
> > I believe that this arbitary limit should be eliminated by some method.
> > However, as a "get you working" patch with a new arbitary limit of 1024
> > characters:
> 
> I was already wondering, how much I should allow. :)
> But I'd rather set an arbitrary limit (and warn) than allowing an 
> arbitrary long string.

That'd also work, but note that stderr/stdout messages are very easily
missed when using menuconfig.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Up silly limit on .config line length
  2002-11-06 13:32 ` Roman Zippel
  2002-11-06 13:34   ` Russell King
@ 2002-11-06 21:32   ` Sam Ravnborg
  1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2002-11-06 21:32 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Russell King, linux-kernel

On Wed, Nov 06, 2002 at 02:32:30PM +0100, Roman Zippel wrote:
> 
> I was already wondering, how much I should allow. :)
> But I'd rather set an arbitrary limit (and warn) than allowing an 
> arbitrary long string.
Since this has an unknown effect it should give an error, not just a
warning.
In the case raised by Russell an error would have been better, he would
never try to boot the kernel in that case.

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-06 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 23:38 [PATCH] Up silly limit on .config line length Russell King
2002-11-06 13:32 ` Roman Zippel
2002-11-06 13:34   ` Russell King
2002-11-06 21:32   ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®