Bug 3242 - kernel init/setup parameters with double quotes don't work.
kernel init/setup parameters with double quotes don't work.
Product: ACPI
Classification: Unclassified
Component: Other
i386 Linux
: P2 normal
Assigned To: Wang, Zhenyu Z
Depends on:
  Show dependency treegraph
Reported: 2004-08-19 01:57 UTC by Christian Lupien
Modified: 2004-11-04 13:51 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.7
Tree: Mainline
Regression: ---

patch as attachment (450 bytes, patch)
2004-08-19 01:58 UTC, Christian Lupien
Details | Diff

Description Christian Lupien 2004-08-19 01:57:29 UTC
Distribution: Fedora core 2
Hardware Environment: Gateway laptop Solo 9550
Software Environment:  kernel 2.6.7 + swsusp2 patch + acpi patch
Problem Description:
   I was trying to use the acpi_os_name="Microsoft Windows NT" kernel parameter
but it was not being used. I tracked down the problem to an interaction between
the parser in kernel/params.c which first parses the options. It skips double
quotes and removes the = sign. But since acpi_os_name= is an 'obsolete' style
parameter eventually unknown_bootoption (in init/main.c) gets called with 
param pointing to acpi_os_name (no =) and val points to the M of Microsoft...

Before calling obsolete_checksetup(param) which should do the job, it needs to
undo what the previous parser did but it is not taking account of the presence
of the quote (so the = is not added at the correct place and the option is not
dectected:  "acpi_os_name" != "acpi_os_name=")

Here is a patch that fices the problem for me:
--- init/main.c.orig    2004-08-19 04:42:43.714880960 -0400
+++ init/main.c 2004-08-19 04:43:17.455751568 -0400
@@ -265,8 +265,10 @@
 static int __init unknown_bootoption(char *param, char *val)
        /* Change NUL term back to "=", to make "param" the whole string. */
-       if (val)
-               val[-1] = '=';
+       if (val) {
+               if (val[-1] == '"') val[-2] = '=';
+               else val[-1] = '=';
+       }
        /* Handle obsolete-style parameters */
        if (obsolete_checksetup(param))
Comment 1 Christian Lupien 2004-08-19 01:58:57 UTC
Created attachment 3528 [details]
patch as attachment
Comment 2 Wang, Zhenyu Z 2004-09-03 02:36:32 UTC
Patch looks fine. I've also tested it ok.

Len, please apply this.

Comment 3 Len Brown 2004-11-04 13:51:51 UTC
shipped in 2.6.9 - closing.

Note You need to log in before you can comment on or make changes to this bug.