FS#13900 - [mkinitcpio] param acpi_osi does not provide whitespaces

Attached to Project: Arch Linux
Opened by Sebastian Wiemer (syracus) - Saturday, 21 March 2009, 13:27 GMT
Last edited by Thomas Bächler (brain0) - Wednesday, 04 May 2011, 07:04 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:

Linux <host> 2.6.28-ARCH #1 SMP PREEMPT .... i686 VIA C7-M Processor 1600Mhz CentaurHauls GNU/Linux

As of trying out a kernel workaround for hp 2133 mini to get apci cpu scaling working i tried a suggesten found in several forum threads. For that notebook with the most current bios version someone should try to give the kernel parameter

acpi_osi="!Windows 2006"

On reboot init stops with kernel panic complaining that 2006" is an invalid parameter option. Investigating further it seems that whitespaces are not supported.

Neither masking with \<space> nor '_' works as expected.

Not really sure if whitespaces should be allowed in kernel parameters, but it seems to work with several other distros (ubuntu, fedora, mint). Maybe this is further more related to grub than kernel. Sorry if this report is categorized the wrong way.



Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

Just add acpi_osi="!Windows 2006" to kernel parameter line in /boot/grub/menu.lst (regardless if after or before ro) and reboot

This task depends upon

Closed by  Thomas Bächler (brain0)
Wednesday, 04 May 2011, 07:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  mkinitcpio 0.6.11
Comment by Roman Kyrylych (Romashka) - Thursday, 28 May 2009, 18:50 GMT
status with 2.6.29?
Comment by David (staple) - Friday, 31 July 2009, 06:44 GMT
  • Field changed: Percent Complete (100% → 0%)
Still doesn't work for me
Comment by Roman Kyrylych (Romashka) - Friday, 31 July 2009, 06:45 GMT
Please report it to bugzilla.kernel.org or lkml to get it fixed
Comment by David (staple) - Saturday, 01 August 2009, 16:35 GMT
but it works on other distros.
Comment by Thomas Bächler (brain0) - Sunday, 02 August 2009, 08:09 GMT
This is a shortcoming of the option parsing in our initramfs. There was an unresolved bug about it already.
Comment by David (staple) - Wednesday, 05 August 2009, 03:20 GMT
and for what it's worth this bug also affects 64 bit
Comment by David (staple) - Sunday, 06 September 2009, 20:07 GMT
any news on this? i really want to install arch but this is a showstopper for me :)
Comment by tom (tom) - Monday, 26 October 2009, 20:16 GMT
tackling this same problem I found this (temporary?) solution:
there is a for loop processing the kernel command line args in the initrd's /bin/init script:
for cmd in ${CMDLINE}; do
case "${cmd}" in
\#*) break ;; # ignore everything after a # in the commandline
# The kernel passes those to the kernel on its own
[0123456Ss]) ;;
single) ;;
#Allow "init=X" to pass-through
init=*) kinit_params="${kinit_params} ${cmd}" ;;
# only export stuff that does work with dash :)
*=*) cmd="$(replace -s= "${cmd}" '.' '_')"
cmd="$(replace -s= "${cmd}" '-' '_')"
export "${cmd}"
;;
*) cmd="$(replace "${cmd}" '.' '_')"
cmd="$(replace "${cmd}" '-' '_')"
export "${cmd}=y"
;;
esac
done

the shell chops
acpi_osi="!Windows
and
2006"
into two separate arguments and get processed by the last two (respectively) case matches.
for acpi_osi="!Windows this works (although is useless)
but for 2006" this does not work (it attempts to export an environment variable with the name 2006" which isn't allowed)

the solution here is already there: the #* match that breaks from the loop so you can insert that prior to the acpi_osi variable.
here is my grub entry as an example:

title Arch
root (hd0,3)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/..... ro vga=773 # acpi_osi="!Windows 2006"
initrd /boot/kernel26.img

the kernel will still process this argument but that shell loop will not.
Comment by tom (tom) - Monday, 26 October 2009, 20:18 GMT
wow that's ugly so much for WYSIWYG :)
Comment by syl (syl) - Friday, 11 December 2009, 09:47 GMT
This bug is important for Sony VAIO Z Series users.
Please help :-)
Comment by tom (tom) - Friday, 11 December 2009, 15:07 GMT
syl: I am a VAIO Z user as well--adding the '#' character to your grub config (/boot/grub/menu.lst) line as in my example should solve this problem for you
Comment by syl (syl) - Friday, 11 December 2009, 15:20 GMT
Hi Tom, thanks for the info. I'll PM you, if you don't mind.
cheers
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 12 February 2010, 18:39 GMT
what is the status of this issue with new mkinitcpio-0.6?
Comment by Thomas Bächler (brain0) - Friday, 12 February 2010, 21:13 GMT
Unchanged, I still don't really know how to solve it currently.
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 12 February 2010, 21:53 GMT
mmm, I tested it and boot without any issues. Seems that the error is ignored with the new mkinitcpio. Of course the env var for acpi_osi is not complete, but this is irrelevant.

# set
CMDLINE='root=/dev/disk/by-uuid/4ad49bf5-f44a-4116-8164-704bcecc5c59 ro console=ttyS0 acpi_osi="!Windows 2006" break=y'
...
acpi_osi='"!Windows'
...
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 13 February 2010, 00:08 GMT
@brain0: Just as "proof of concept", but if you considered good, ok and go ahead.

Also attached how look a sample command line.
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 20 February 2010, 07:30 GMT
Anyway, I don't know why this works with the patch: somevar="somevaluewithoutspace". If you try with a separate script, does not work. Weird!
Comment by Thomas Bächler (brain0) - Saturday, 20 February 2010, 11:19 GMT
I haven't seen this patch before, sorry.

I was thinking about a different approach: What if we only try to export things that are actually of interest to us and ignore the rest? No idea how to do that yet, but: we are not at all interested in the value of acpi_osi or most of the other stuff passed to the kernel. Basically, we want to know rw, ro, root=, cryptdevice=, crypto= (deprecated), cryptkey=, resume=, break= and very few more that I don't remember now.

IMO, there is no point in adding support for parsing a variable that we will just ignore anyway.
Comment by Thomas Bächler (brain0) - Saturday, 20 February 2010, 11:41 GMT
Just thought let's look what other distros do. This is what SuSE does:

# kernel commandline parsing
for o in $(cat /proc/cmdline); do
key="${o%%=*}"
key="${key//-/_}"
if [ "${key%.*}" != "${key}" ]; then # module parameter
add_module_param "${key%.*}" "${o#*.}"
else
# environment variable
# set local variables too, in case somehow the kernel does not do this correctly
value="${o#*=}"
value=${value:=1}
eval cmd_$key="${value}"
eval $key="${value}" 2> /dev/null
fi
done

I don't think they ignore this problem too.
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 20 February 2010, 16:02 GMT
> I haven't seen this patch before, sorry.
No problem.

About only accept needed params, is interesting. Something like: init script with a dynamic and configurable parameters via each install conf hook. So can have a file like ""/init_acepted_parameters"" generated by mkinitcpio. (If and only if is not much complicated with ash :P)
Comment by Thomas Bächler (brain0) - Saturday, 20 February 2010, 16:06 GMT
Something like that, yes. Would need changes in all hooks though.
Comment by Thomas Bächler (brain0) - Sunday, 10 April 2011, 20:32 GMT
Please confirm that mkinitcpio 0.6.10 fixes the problem.

Loading...