← Back to team overview

sony-vaio-z-series team mailing list archive

Re: grub2 and acpi_osi

 

On Fr, 09 Okt 2009, Raphael Gradenwitz wrote:
> The *Quotes* are not part of the argument but the *Space* between
> Windows and 2006 is.
> 
> And /proc/cmdline is parsed in a way like:
> 
> for ARG in $(cat /proc/cmdline)
> do
>     echo "${ARG}"|grep -q "=" && ${ARG%=*}=${ARG##*=}
> done

I don't get that!!??? The kernel does not use shell to parse the
cmdline args, they are passed INTO the kernel from the grub 
loader via putting the different argumetns onto the stack
before jumping to the kernel entry point.

The kernel afterwards puts the arguments as read from the stack into
some place to be shown in /proc/cmdline, but it never evaluates them
in the way you said.

> and as you can see, that would result in
> acpi_osi=!Windows
> and 2006 wil be interpreted as a (not understood) alone standing word.

Yes that would be the case if some later shell scriupt has to parse
the cmd line, but that is irrelevant since acpi_osi is a kernel
parameter.

> There is no way for the kernel other than "guessing" if the next word is
> part of the argument and if not. OK, it could check the result with a

No. The way is simply what has been put on the execution stack.

The *kernel* is not *reading* /proc/cmdline, it is showing
us what the cmdline was with which it was called.

> Is the led on the stamina-speed slider burning on your vaio after a
> reboot? Even if your /proc/cmdline had the argument without quotes the
> boot before?

Yes, and even the right one when I switch between the two modes.

> For me it does *not*.

Really strange.

> root=UUID=b4acd5c9-258f-47fc-8a8c-0f497f6f5137 ro splash vga=791 acpi_osi="!Windows 2006" acpi_backlight=vendor
> 
> and after a boot with grub2:
> :~$ cat /proc/cmdline
> root=UUID=b4acd5c9-258f-47fc-8a8c-0f497f6f5137 ro splash vga=791 acpi_osi=!Windows 2006 acpi_backlight=vendor


Yes of course. My view is:
- grup puts these thing on the execution stack:
	root=UUID=b4acd5c9-258f-47fc-8a8c-0f497f6f5137
	ro
	splash
	vga=791
	acpi_osi=!Windows 2006
	 acpi_backlight=vendor
- the kernel reads that in and evaluates the stuff.
- then the kernel puts the args into a list:
	root=... ro splash vga=791 acpi_osi=!Windows 2006 ...
  and exhibits that in /proc/cmdline.

> When I boot with grub2 and edit the comandline in the grub shell by hand
> puting a backslash in front of those quote-signs:
> acpi_osi=\"!Windows 2006\"
> than it works.

"works" for you means that it is shown as that in /proc/cmline, but
that *does*not*count* at all!

When I have more time I will hack the kernel to actually show me what
his idea of cmd line is and show you the output.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining                                        Associate Professor
JAIST Japan Advanced Institute of Science and Technology   preining@xxxxxxxxxxx
Vienna University of Technology                               preining@xxxxxxxx
Debian Developer (Debian TeX Task Force)                    preining@xxxxxxxxxx
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BRADWORTHY
One who is skilled in the art of naming loaves.
			--- Douglas Adams, The Meaning of Liff



Follow ups

References