FS#10002 - Initcpio can't handle acpi_os_name="Microsoft Windows XP"

Attached to Project: Arch Linux
Opened by Matthias Dienstbier (fs4000) - Friday, 28 March 2008, 21:49 GMT
Last edited by Roman Kyrylych (Romashka) - Saturday, 27 December 2008, 14:21 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I tried to boot with acpi_os_name="Microsoft Windows XP" as described here:
http://forums.gentoo.org/viewtopic.php?t=122145
and got an error from Initcpio:
:: Loading Initramfs
export: 44: XP": bad variable name
Kernel panic - not syncing: Attempted to kill init!

Additional info:
* package version(s)
mkinitcpio 0.5.17-2
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Saturday, 27 December 2008, 14:21 GMT
Reason for closing:  Fixed
Comment by Jan de Groot (JGC) - Saturday, 29 March 2008, 10:16 GMT
What if you make it acpi_os_name="Microsoft\ Windows\ XP"? Does it pick up the backslashes, or does it strip them?
Comment by Matthias Dienstbier (fs4000) - Saturday, 29 March 2008, 12:56 GMT
Nope, gives exactly the same error.
I don't know very much about shell-scripts, but the problem must be in this line:
for cmd in $CMDLINE; do
then the line
export "${cmd}=y"
must try to do this: export "XP"=y"
Comment by Thomas Bächler (brain0) - Tuesday, 08 April 2008, 17:21 GMT
This problem is more subtle than one would expect. The option acpi_os_name is passed to the kernel as "Microsoft Windows XP". The kernel recognizes it and acts upon it. However, now /init tries to parse the commandline, as it wants to interpret some of the options. The option acpi_os_name is not interesting for us, so we would ignore it.

However, /init parses the commadline word-wise, so now acpi_os_name="Microsoft is exported, then Windows=y is exported and then it tries to export XP"=y. It cannot handle quoting. I cannot think of a proper quick fix for the quoting, but I can provide you with a workaround:

Insert this line between line 21 and 22 in /lib/initcpio/init:
*\"*) ;;
Then regenerate your image with 'mkinitcpio -p kernel26'. Make a copy of your old image in case you break it. That is not a proper fix for the issue, it only ignores the XP" on the commandline and should make your system boot correctly, hopefully.
Comment by Aaron Griffin (phrakture) - Tuesday, 08 April 2008, 17:46 GMT
I wish there was an easy way to parse quoted params... I can't come up with anything either

I wonder if the following would work:
acpi_os_name=Microsoft\ Windows\ XP

Comment by Thomas Bächler (brain0) - Tuesday, 08 April 2008, 18:05 GMT
Depends on how Linux parses the commandline parameters. It's worth a try.

We should still respect quoting when parsing the commandline, as Linux does it as well ...
Comment by Matthias Dienstbier (fs4000) - Tuesday, 08 April 2008, 18:06 GMT
Yes, this works and it shows a little effect on STR. Now the computer runs a few seconds before it reboots.
The first progress within years, perhaps I will get it working some day. ;-)
Comment by Thomas Bächler (brain0) - Tuesday, 08 April 2008, 18:10 GMT
The question is, does Linux actually accept "Microsoft Windows XP" as acpi_os_name when using Aaron's method. Is there a hint in dmesg about it?
Comment by Matthias Dienstbier (fs4000) - Tuesday, 08 April 2008, 18:12 GMT
Oh, I overlooked your first post, brain0.
I tested acpi_os_name=Microsoft\ Windows\ XP
Comment by Matthias Dienstbier (fs4000) - Tuesday, 08 April 2008, 20:12 GMT
It doesn't recognize the whole string:
ACPI: Overriding _OS definition to 'Microsoft'
I tried to boot with your initcpio-fix, but got this:
http://mwd.bplaced.net/up/boot.jpg
I removed the acpi_os_name option and it worked again. I have no idea why!
PS: The Computer didn't suspend with the correct acpi_os_name either. :-(
Comment by Thomas Bächler (brain0) - Tuesday, 08 April 2008, 20:25 GMT
That is too much weirdness for me now. I will have to experiment with this myself.
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 23:42 GMT
What's the status of this issue?
Comment by Matthias Dienstbier (fs4000) - Sunday, 07 December 2008, 00:19 GMT
It works with
# acpi_os_name="Microsoft Windows XP"
now. I tested this at that time, too, but somehow it didn't prevent initcpio from parsing. Now it does.

However I didn't get Suspend working until now. The BIOS must be really buggy.

Loading...