* [PATCH] kernel: allow whitespace as kernel parameter separator
@ 2009-07-06 15:11 Peter Oberparleiter
2009-07-07 5:03 ` Rusty Russell
0 siblings, 1 reply; 2+ messages in thread
From: Peter Oberparleiter @ 2009-07-06 15:11 UTC (permalink / raw)
To: Rusty Russell; +Cc: Linux Kernel Mailing List
From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Some boot mechanisms require that kernel parameters are stored in a
separate file which is loaded to memory without further processing
(e.g. the "Load from FTP" method on s390). When such a file contains
newline characters, the kernel parameter preceding the newline might
not be correctly parsed (due to the newline being stuck to the end of
the actual parameter value) which can lead to boot failures.
This patch improves kernel command line usability in such a situation
by allowing generic whitespace characters as separators between kernel
parameters.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
---
kernel/params.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: linux-2.6.31-rc2/kernel/params.c
===================================================================
--- linux-2.6.31-rc2.orig/kernel/params.c
+++ linux-2.6.31-rc2/kernel/params.c
@@ -23,6 +23,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <linux/ctype.h>
#if 0
#define DEBUGP printk
@@ -87,7 +88,7 @@ static char *next_arg(char *args, char *
}
for (i = 0; args[i]; i++) {
- if (args[i] == ' ' && !in_quote)
+ if (isspace(args[i]) && !in_quote)
break;
if (equals == 0) {
if (args[i] == '=')
@@ -121,7 +122,7 @@ static char *next_arg(char *args, char *
next = args + i;
/* Chew up trailing spaces. */
- while (*next == ' ')
+ while (isspace(*next))
next++;
return next;
}
@@ -138,7 +139,7 @@ int parse_args(const char *name,
DEBUGP("Parsing ARGS: %s\n", args);
/* Chew leading spaces */
- while (*args == ' ')
+ while (isspace(*args))
args++;
while (*args) {
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] kernel: allow whitespace as kernel parameter separator
2009-07-06 15:11 [PATCH] kernel: allow whitespace as kernel parameter separator Peter Oberparleiter
@ 2009-07-07 5:03 ` Rusty Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2009-07-07 5:03 UTC (permalink / raw)
To: Peter Oberparleiter; +Cc: Linux Kernel Mailing List
On Tue, 7 Jul 2009 12:41:22 am Peter Oberparleiter wrote:
> From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
>
> Some boot mechanisms require that kernel parameters are stored in a
> separate file which is loaded to memory without further processing
> (e.g. the "Load from FTP" method on s390). When such a file contains
> newline characters, the kernel parameter preceding the newline might
> not be correctly parsed (due to the newline being stuck to the end of
> the actual parameter value) which can lead to boot failures.
>
> This patch improves kernel command line usability in such a situation
> by allowing generic whitespace characters as separators between kernel
> parameters.
Makes sense, applied.
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-07 5:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 15:11 [PATCH] kernel: allow whitespace as kernel parameter separator Peter Oberparleiter
2009-07-07 5:03 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox