From: Rusty Russell As noticed by Joey Hess (and thanks for Christoph for forwarding it). Also requirements from Werner Almesberger. If someone passes 'foo="some value"' the param engine removes the quotes and hands 'foo' and 'some value'. The __setup() parameters expect a single string, and so we try to regenerate it from the two parts. Finally, we try to place it as an environment variable. Werner wants quotes stripped out of the environment variable. It makes sense to do that for __setup, too (so it sees 'foo=some value'), since __setup functions don't usually handle quotes. Signed-off-by: Rusty Russell Signed-off-by: Andrew Morton --- 25-akpm/init/main.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff -puN init/main.c~boot-parameters-quoting-of-environment-variables-revisited init/main.c --- 25/init/main.c~boot-parameters-quoting-of-environment-variables-revisited 2004-10-21 21:22:13.452780416 -0700 +++ 25-akpm/init/main.c 2004-10-21 21:22:13.457779656 -0700 @@ -288,8 +288,15 @@ static int __init unknown_bootoption(cha { /* Change NUL term back to "=", to make "param" the whole string. */ if (val) { - if (val[-1] == '"') val[-2] = '='; - else val[-1] = '='; + /* param=val or param="val"? */ + if (val == param+strlen(param)+1) + val[-1] = '='; + else if (val == param+strlen(param)+2) { + val[-2] = '='; + memmove(val-1, val, strlen(val)+1); + val--; + } else + BUG(); } /* Handle obsolete-style parameters */ _