* x86: fix to parse multiboot command line passed by latest grub
@ 2009-12-07 8:23 Wei Yongjun
2009-12-07 8:26 ` [PATCH] " Wei Yongjun
2009-12-07 9:57 ` Keir Fraser
0 siblings, 2 replies; 10+ messages in thread
From: Wei Yongjun @ 2009-12-07 8:23 UTC (permalink / raw)
To: Keir Fraser, xen-devel
latest grub had changed to "don't pass filename in multiboot
command line".
The old cmdline format is: "module-name options..."
The new cmdline format is: "options..."
So xen + grub2 always loss the first option, because xen will
skip the first option.
Usually, the module-name is not start with char [a-zA-Z], such
as /boot/vmlinuz, (hd0,1)/boot/vmlinuz, so this patch added
isalpha() test of the first char of module-name/option to
function cmdline_cook(), try to handle both the old and new
cmdline format.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -423,6 +423,8 @@
p = p ? : "";
while ( *p == ' ' )
p++;
+ if (isalpha(*p))
+ return p;
while ( (*p != ' ') && (*p != '\0') )
p++;
while ( *p == ' ' )
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH] x86: fix to parse multiboot command line passed by latest grub
2009-12-07 8:23 x86: fix to parse multiboot command line passed by latest grub Wei Yongjun
@ 2009-12-07 8:26 ` Wei Yongjun
2009-12-07 9:19 ` Ian Campbell
2009-12-07 9:57 ` Keir Fraser
1 sibling, 1 reply; 10+ messages in thread
From: Wei Yongjun @ 2009-12-07 8:26 UTC (permalink / raw)
To: Keir Fraser, xen-devel
latest grub had changed to "don't pass filename in multiboot
command line".
The old cmdline format is: "module-name options..."
The new cmdline format is: "options..."
So xen + grub2 always loss the first option, because xen will
skip the first option.
Usually, the module-name is not start with char [a-zA-Z], such
as /boot/vmlinuz, (hd0,1)/boot/vmlinuz, so this patch added
isalpha() test of the first char of modulename/option to
function cmdline_cook(), try to handle both the old and new
cmdline format.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -423,6 +423,8 @@
p = p ? : "";
while ( *p == ' ' )
p++;
+ if (isalpha(*p))
+ return p;
while ( (*p != ' ') && (*p != '\0') )
p++;
while ( *p == ' ' )
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] x86: fix to parse multiboot command line passed by latest grub
2009-12-07 8:26 ` [PATCH] " Wei Yongjun
@ 2009-12-07 9:19 ` Ian Campbell
2009-12-07 9:47 ` Wei Yongjun
2009-12-07 9:48 ` [PATCHv2] " Wei Yongjun
0 siblings, 2 replies; 10+ messages in thread
From: Ian Campbell @ 2009-12-07 9:19 UTC (permalink / raw)
To: Wei Yongjun; +Cc: xen-devel@lists.xensource.com, Keir Fraser
On Mon, 2009-12-07 at 08:26 +0000, Wei Yongjun wrote:
> latest grub had changed to "don't pass filename in multiboot
> command line".
>
> The old cmdline format is: "module-name options..."
> The new cmdline format is: "options..."
>
> So xen + grub2 always loss the first option, because xen will
> skip the first option.
>
> Usually, the module-name is not start with char [a-zA-Z], such
> as /boot/vmlinuz, (hd0,1)/boot/vmlinuz, so this patch added
> isalpha() test of the first char of modulename/option to
> function cmdline_cook(), try to handle both the old and new
> cmdline format.
Xen doesn't actually complain about unknown options, does it? So why not
simply stop stripping the first option altogether? Under grub1 Xen will
just ignore it and under grub2 it won't be passed in.
Ian.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -423,6 +423,8 @@
> p = p ? : "";
> while ( *p == ' ' )
> p++;
> + if (isalpha(*p))
> + return p;
> while ( (*p != ' ') && (*p != '\0') )
> p++;
> while ( *p == ' ' )
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] x86: fix to parse multiboot command line passed by latest grub
2009-12-07 9:19 ` Ian Campbell
@ 2009-12-07 9:47 ` Wei Yongjun
2009-12-07 9:48 ` [PATCHv2] " Wei Yongjun
1 sibling, 0 replies; 10+ messages in thread
From: Wei Yongjun @ 2009-12-07 9:47 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel@lists.xensource.com, Keir Fraser
Ian Campbell wrote:
> On Mon, 2009-12-07 at 08:26 +0000, Wei Yongjun wrote:
>
>> latest grub had changed to "don't pass filename in multiboot
>> command line".
>>
>> The old cmdline format is: "module-name options..."
>> The new cmdline format is: "options..."
>>
>> So xen + grub2 always loss the first option, because xen will
>> skip the first option.
>>
>> Usually, the module-name is not start with char [a-zA-Z], such
>> as /boot/vmlinuz, (hd0,1)/boot/vmlinuz, so this patch added
>> isalpha() test of the first char of modulename/option to
>> function cmdline_cook(), try to handle both the old and new
>> cmdline format.
>>
>
> Xen doesn't actually complain about unknown options, does it? So why not
> simply stop stripping the first option altogether? Under grub1 Xen will
> just ignore it and under grub2 it won't be passed in.
>
That it is OK. But the module-name will pass to the dom0, the cmdline of
dom0 like this
under grub1:
# cat /proc/cmdline
/boot/vmlinuz-2.6.31.6-xen
root=UUID=575f3be9-0a50-4d62-a36d-800e85a7aa70 ro console=tty0
Other way, I will send a patch as your advice^_^.
Thanks
> Ian.
>
>
>> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>>
>> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -423,6 +423,8 @@
>> p = p ? : "";
>> while ( *p == ' ' )
>> p++;
>> + if (isalpha(*p))
>> + return p;
>> while ( (*p != ' ') && (*p != '\0') )
>> p++;
>> while ( *p == ' ' )
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCHv2] x86: fix to parse multiboot command line passed by latest grub
2009-12-07 9:19 ` Ian Campbell
2009-12-07 9:47 ` Wei Yongjun
@ 2009-12-07 9:48 ` Wei Yongjun
1 sibling, 0 replies; 10+ messages in thread
From: Wei Yongjun @ 2009-12-07 9:48 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel@lists.xensource.com, Keir Fraser
latest grub had changed to "don't pass filename in multiboot
command line".
The old cmdline format is: "module-name options..."
The new cmdline format is: "options..."
So xen + grub2 always loss the first option, because xen will
skip the first option.
Since xen doesn't actually complain about unknown options, so
simply stop stripping the first option altogether, under grub1
Xen will just ignore it and under grub2 it won't be passed in.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -423,10 +423,6 @@
p = p ? : "";
while ( *p == ' ' )
p++;
- while ( (*p != ' ') && (*p != '\0') )
- p++;
- while ( *p == ' ' )
- p++;
return p;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: x86: fix to parse multiboot command line passed by latest grub
2009-12-07 8:23 x86: fix to parse multiboot command line passed by latest grub Wei Yongjun
2009-12-07 8:26 ` [PATCH] " Wei Yongjun
@ 2009-12-07 9:57 ` Keir Fraser
2009-12-07 10:54 ` Samuel Thibault
1 sibling, 1 reply; 10+ messages in thread
From: Keir Fraser @ 2009-12-07 9:57 UTC (permalink / raw)
To: Wei Yongjun, xen-devel@lists.xensource.com
I recommend just sticking a dummy first arg when writing a command line for
grub2, and living with it. Or get grub2 guys to give us a flag to detect
this stupid compatibility breakage. I don't really want hacks like this.
-- Keir
On 07/12/2009 08:23, "Wei Yongjun" <yjwei@cn.fujitsu.com> wrote:
> latest grub had changed to "don't pass filename in multiboot
> command line".
>
> The old cmdline format is: "module-name options..."
> The new cmdline format is: "options..."
>
> So xen + grub2 always loss the first option, because xen will
> skip the first option.
>
> Usually, the module-name is not start with char [a-zA-Z], such
> as /boot/vmlinuz, (hd0,1)/boot/vmlinuz, so this patch added
> isalpha() test of the first char of module-name/option to
> function cmdline_cook(), try to handle both the old and new
> cmdline format.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -423,6 +423,8 @@
> p = p ? : "";
> while ( *p == ' ' )
> p++;
> + if (isalpha(*p))
> + return p;
> while ( (*p != ' ') && (*p != '\0') )
> p++;
> while ( *p == ' ' )
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: x86: fix to parse multiboot command line passed by latest grub
2009-12-07 9:57 ` Keir Fraser
@ 2009-12-07 10:54 ` Samuel Thibault
2009-12-07 22:00 ` Simon Horman
0 siblings, 1 reply; 10+ messages in thread
From: Samuel Thibault @ 2009-12-07 10:54 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com, Wei Yongjun
Keir Fraser, le Mon 07 Dec 2009 09:57:41 +0000, a écrit :
> I recommend just sticking a dummy first arg when writing a command line for
> grub2, and living with it.
That's what we did in GNU Mach.
> Or get grub2 guys to give us a flag to detect
> this stupid compatibility breakage.
They said multiboot never asserted anything about the command line and
thus implementation were allowed to vary without notice. The rationale
for grub's behavior change is that the user has to migrate from grub1
syntax to grub2 syntax anyway.
> I don't really want hacks like this.
It was out of question to commit things like this in GNU Mach as well :)
Samuel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: x86: fix to parse multiboot command line passed by latest grub
2009-12-07 10:54 ` Samuel Thibault
@ 2009-12-07 22:00 ` Simon Horman
2009-12-07 22:46 ` Samuel Thibault
2009-12-08 7:39 ` Keir Fraser
0 siblings, 2 replies; 10+ messages in thread
From: Simon Horman @ 2009-12-07 22:00 UTC (permalink / raw)
To: Samuel Thibault, Keir Fraser, Wei Yongjun,
xen-devel@lists.xensource.com
On Mon, Dec 07, 2009 at 11:54:55AM +0100, Samuel Thibault wrote:
> Keir Fraser, le Mon 07 Dec 2009 09:57:41 +0000, a écrit :
>
> > Or get grub2 guys to give us a flag to detect
> > this stupid compatibility breakage.
>
> They said multiboot never asserted anything about the command line and
> thus implementation were allowed to vary without notice. The rationale
> for grub's behavior change is that the user has to migrate from grub1
> syntax to grub2 syntax anyway.
They broke it because they could? :-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: x86: fix to parse multiboot command line passed by latest grub
2009-12-07 22:00 ` Simon Horman
@ 2009-12-07 22:46 ` Samuel Thibault
2009-12-08 7:39 ` Keir Fraser
1 sibling, 0 replies; 10+ messages in thread
From: Samuel Thibault @ 2009-12-07 22:46 UTC (permalink / raw)
To: Simon Horman; +Cc: xen-devel@lists.xensource.com, Keir Fraser, Wei Yongjun
Simon Horman, le Tue 08 Dec 2009 09:00:00 +1100, a écrit :
> On Mon, Dec 07, 2009 at 11:54:55AM +0100, Samuel Thibault wrote:
> > Keir Fraser, le Mon 07 Dec 2009 09:57:41 +0000, a écrit :
> >
> > > Or get grub2 guys to give us a flag to detect
> > > this stupid compatibility breakage.
> >
> > They said multiboot never asserted anything about the command line and
> > thus implementation were allowed to vary without notice. The rationale
> > for grub's behavior change is that the user has to migrate from grub1
> > syntax to grub2 syntax anyway.
>
> They broke it because they could? :-)
Yes...
Samuel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: x86: fix to parse multiboot command line passed by latest grub
2009-12-07 22:00 ` Simon Horman
2009-12-07 22:46 ` Samuel Thibault
@ 2009-12-08 7:39 ` Keir Fraser
1 sibling, 0 replies; 10+ messages in thread
From: Keir Fraser @ 2009-12-08 7:39 UTC (permalink / raw)
To: Simon Horman, Samuel Thibault, Wei Yongjun,
xen-devel@lists.xensource.com
On 07/12/2009 22:00, "Simon Horman" <horms@verge.net.au> wrote:
>>> Or get grub2 guys to give us a flag to detect
>>> this stupid compatibility breakage.
>>
>> They said multiboot never asserted anything about the command line and
>> thus implementation were allowed to vary without notice. The rationale
>> for grub's behavior change is that the user has to migrate from grub1
>> syntax to grub2 syntax anyway.
>
> They broke it because they could? :-)
Yes, it's both stupid and arrogant. Oh well.
-- Keir
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-12-08 7:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 8:23 x86: fix to parse multiboot command line passed by latest grub Wei Yongjun
2009-12-07 8:26 ` [PATCH] " Wei Yongjun
2009-12-07 9:19 ` Ian Campbell
2009-12-07 9:47 ` Wei Yongjun
2009-12-07 9:48 ` [PATCHv2] " Wei Yongjun
2009-12-07 9:57 ` Keir Fraser
2009-12-07 10:54 ` Samuel Thibault
2009-12-07 22:00 ` Simon Horman
2009-12-07 22:46 ` Samuel Thibault
2009-12-08 7:39 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.