* [bug] Wrong machtype argument passed for fuloong-2f
@ 2011-10-29 9:36 David Kuehling
2011-10-29 10:37 ` Andreas Barth
0 siblings, 1 reply; 12+ messages in thread
From: David Kuehling @ 2011-10-29 9:36 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 632 bytes --]
hi,
according to my /proc/cmdline grub passes
machtype=lemote-fuloong-2f-unknown as first argument to the linux
kernel.
This is determined in linux.c:
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/loader/mips/linux.c
however, Linux only understands lemote-fuloong-2f-box, according to:
http://git.linux-mips.org/?p=linux.git;a=blob;f=arch/mips/loongson/common/machtype.c;h=2efd5d9dee27192f8a0da79698eb79b5c6e9828c;hb=linux-3.0-stable
cheers,
David
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 9:36 [bug] Wrong machtype argument passed for fuloong-2f David Kuehling
@ 2011-10-29 10:37 ` Andreas Barth
2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Andreas Barth @ 2011-10-29 10:37 UTC (permalink / raw)
To: The development of GNU GRUB
* David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
> according to my /proc/cmdline grub passes
> machtype=lemote-fuloong-2f-unknown as first argument to the linux
> kernel.
Did you see any issues because of that in Linux? Fallback within linux
is MACH_LEMOTE_FL2F which is the one used with the argument
"lemote-fuloong-2f-box" (not saying this bug shouldn't be fixed, but
...). Also I think grub should just forward the parameters added by
pmon, but not adding them itself (except for the parameters via the
grub configuration, e.g. root=...).
Andi
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:37 ` Andreas Barth
@ 2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-29 10:45 ` Andreas Barth
2011-10-29 11:43 ` David Kuehling
2011-10-29 20:46 ` David Kuehling
2 siblings, 1 reply; 12+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-10-29 10:41 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]
On 29.10.2011 12:37, Andreas Barth wrote:
> * David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
>> according to my /proc/cmdline grub passes
>> machtype=lemote-fuloong-2f-unknown as first argument to the linux
>> kernel.
> Did you see any issues because of that in Linux? Fallback within linux
> is MACH_LEMOTE_FL2F which is the one used with the argument
> "lemote-fuloong-2f-box" (not saying this bug shouldn't be fixed, but
> ...). Also I think grub should just forward the parameters added by
> pmon, but not adding them itself (except for the parameters via the
> grub configuration, e.g. root=...).
GRUB isn't restricted ot pmon environments so this argument makes little
sense to me.
>
> Andi
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-10-29 10:45 ` Andreas Barth
2011-10-29 10:54 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 12+ messages in thread
From: Andreas Barth @ 2011-10-29 10:45 UTC (permalink / raw)
To: The development of GNU GRUB
* Vladimir 'φ-coder/phcoder' Serbinenko (phcoder@gmail.com) [111029 12:42]:
> On 29.10.2011 12:37, Andreas Barth wrote:
> > * David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
> >> according to my /proc/cmdline grub passes
> >> machtype=lemote-fuloong-2f-unknown as first argument to the linux
> >> kernel.
> > Did you see any issues because of that in Linux? Fallback within linux
> > is MACH_LEMOTE_FL2F which is the one used with the argument
> > "lemote-fuloong-2f-box" (not saying this bug shouldn't be fixed, but
> > ...). Also I think grub should just forward the parameters added by
> > pmon, but not adding them itself (except for the parameters via the
> > grub configuration, e.g. root=...).
> GRUB isn't restricted ot pmon environments so this argument makes little
> sense to me.
Isn't there a way to detect pmon environments in run time? Basically
that's more like "is there a pmon configuration, and if so, just
forward parameters"? I personally don't see how we could correctly
find out the different variants the linux kernel detects without using
the information the kernel uses, i.e. the command line. And if we use
the command line, we could as well just forward it.
(The optimal case would be device trees everywhere, but well. We are
today.)
Andi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:45 ` Andreas Barth
@ 2011-10-29 10:54 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-29 13:56 ` Andreas Barth
0 siblings, 1 reply; 12+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-10-29 10:54 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
On 29.10.2011 12:45, Andreas Barth wrote:
> * Vladimir 'φ-coder/phcoder' Serbinenko (phcoder@gmail.com) [111029 12:42]:
>> On 29.10.2011 12:37, Andreas Barth wrote:
>>> * David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
>>>> according to my /proc/cmdline grub passes
>>>> machtype=lemote-fuloong-2f-unknown as first argument to the linux
>>>> kernel.
>>> Did you see any issues because of that in Linux? Fallback within linux
>>> is MACH_LEMOTE_FL2F which is the one used with the argument
>>> "lemote-fuloong-2f-box" (not saying this bug shouldn't be fixed, but
>>> ...). Also I think grub should just forward the parameters added by
>>> pmon, but not adding them itself (except for the parameters via the
>>> grub configuration, e.g. root=...).
>> GRUB isn't restricted ot pmon environments so this argument makes little
>> sense to me.
> Isn't there a way to detect pmon environments in run time? Basically
> that's more like "is there a pmon configuration, and if so, just
> forward parameters"? I personally don't see how we could correctly
> find out the different variants the linux kernel detects without using
> the information the kernel uses, i.e. the command line. And if we use
> the command line, we could as well just forward it.
>
Which creates a separate codepath uselessly. If GRUB is firmware it uses
the information available on mkimage time, if loaded by pmon or another
GRUB, use command line.
> (The optimal case would be device trees everywhere, but well. We are
> today.)
>
Device trees have some nonsensical devices, like commandline which I
couldn't find inside of any of my chips.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:54 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-10-29 13:56 ` Andreas Barth
0 siblings, 0 replies; 12+ messages in thread
From: Andreas Barth @ 2011-10-29 13:56 UTC (permalink / raw)
To: The development of GNU GRUB
* Vladimir 'φ-coder/phcoder' Serbinenko (phcoder@gmail.com) [111029 12:55]:
> On 29.10.2011 12:45, Andreas Barth wrote:
> > I personally don't see how we could correctly
> > find out the different variants the linux kernel detects without using
> > the information the kernel uses, i.e. the command line. And if we use
> > the command line, we could as well just forward it.
> Which creates a separate codepath uselessly. If GRUB is firmware it uses
> the information available on mkimage time, if loaded by pmon or another
> GRUB, use command line.
I don't think we disagree here. Sorry if I wrote that wrong.
Andi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:37 ` Andreas Barth
2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-10-29 11:43 ` David Kuehling
2011-10-29 11:48 ` Andreas Barth
2011-10-29 20:46 ` David Kuehling
2 siblings, 1 reply; 12+ messages in thread
From: David Kuehling @ 2011-10-29 11:43 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
>>>>> "Andreas" == Andreas Barth <aba@not.so.argh.org> writes:
> * David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
>> according to my /proc/cmdline grub passes
>> machtype=lemote-fuloong-2f-unknown as first argument to the linux
>> kernel.
> Did you see any issues because of that in Linux?
No, don't think so. (Well, there are some issues with the fuloong box,
but they don't seem to be fixed after patching fuloong's boot argument)
> Fallback within linux is MACH_LEMOTE_FL2F which is the one used with
> the argument "lemote-fuloong-2f-box" (not saying this bug shouldn't be
> fixed, but ...).
I didn't find a method to make linux report the actual mach type that it
is running with, so I don't know what it fell back to, and I just went
the safe route of patching my version of grub.
cheers,
David
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 10:37 ` Andreas Barth
2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-29 11:43 ` David Kuehling
@ 2011-10-29 20:46 ` David Kuehling
2011-10-29 20:54 ` Andreas Barth
2 siblings, 1 reply; 12+ messages in thread
From: David Kuehling @ 2011-10-29 20:46 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]
>>>>> "Andreas" == Andreas Barth <aba@not.so.argh.org> writes:
> * David Kuehling (dvdkhlng@gmx.de) [111029 11:37]:
>> according to my /proc/cmdline grub passes
>> machtype=lemote-fuloong-2f-unknown as first argument to the linux
>> kernel.
> Did you see any issues because of that in Linux? Fallback within linux
> is MACH_LEMOTE_FL2F which is the one used with the argument
> "lemote-fuloong-2f-box" (not saying this bug shouldn't be fixed, but
> ...). Also I think grub should just forward the parameters added by
> pmon, but not adding them itself (except for the parameters via the
> grub configuration, e.g. root=...).
BTW it looks like it is impossible to override machtype= parameter from
the kernel command line configured in boot/grub/grub.cfg, since linux
code in loongson/common/machtype.c uses the first occurence of
"machtype=" in arcs_cmdline[]. Is this behaviour by design or by
accident? Is this linux' fault or grub's fault? One could change grub
to append machtype= rather than prepend it to the command line...
cheers,
David
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 20:46 ` David Kuehling
@ 2011-10-29 20:54 ` Andreas Barth
2011-10-30 3:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 12+ messages in thread
From: Andreas Barth @ 2011-10-29 20:54 UTC (permalink / raw)
To: The development of GNU GRUB
* David Kuehling (dvdkhlng@gmx.de) [111029 22:46]:
> BTW it looks like it is impossible to override machtype= parameter from
> the kernel command line configured in boot/grub/grub.cfg, since linux
> code in loongson/common/machtype.c uses the first occurence of
> "machtype=" in arcs_cmdline[]. Is this behaviour by design or by
> accident? Is this linux' fault or grub's fault? One could change grub
> to append machtype= rather than prepend it to the command line...
I would consider it more appropriate to add a flag "suppress pmon
command line" to the grub configuration - if you want to overwrite it,
it should fully disappear, and not just be not parsed because there is
another one first.
Andi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-29 20:54 ` Andreas Barth
@ 2011-10-30 3:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-30 13:06 ` David Kuehling
0 siblings, 1 reply; 12+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-10-30 3:29 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]
On 29.10.2011 22:54, Andreas Barth wrote:
> * David Kuehling (dvdkhlng@gmx.de) [111029 22:46]:
>> BTW it looks like it is impossible to override machtype= parameter from
>> the kernel command line configured in boot/grub/grub.cfg, since linux
>> code in loongson/common/machtype.c uses the first occurence of
>> "machtype=" in arcs_cmdline[]. Is this behaviour by design or by
>> accident? Is this linux' fault or grub's fault? One could change grub
>> to append machtype= rather than prepend it to the command line...
> I would consider it more appropriate to add a flag "suppress pmon
> command line" to the grub configuration - if you want to overwrite it,
> it should fully disappear, and not just be not parsed because there is
> another one first.
>
As I already said: machtype isn't only about pmon. And I consider it as
part of protocol on loongson so no, it won't be overrideable. Moreover
it's fundamentally wrong to make bugs configurable (bugs=on). Please try
the following patch:
=== modified file 'grub-core/loader/mips/linux.c'
--- grub-core/loader/mips/linux.c 2011-08-19 20:46:11 +0000
+++ grub-core/loader/mips/linux.c 2011-10-30 03:28:36 +0000
@@ -41,7 +41,7 @@
const char loongson_machtypes[][60] =
{
[GRUB_ARCH_MACHINE_YEELOONG] = "machtype=lemote-yeeloong-2f-8.9inches",
- [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-unknown",
+ [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-box",
[GRUB_ARCH_MACHINE_FULOONG2E] = "machtype=lemote-fuloong-2e-unknown"
};
#endif
> Andi
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [bug] Wrong machtype argument passed for fuloong-2f
2011-10-30 3:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-10-30 13:06 ` David Kuehling
0 siblings, 0 replies; 12+ messages in thread
From: David Kuehling @ 2011-10-30 13:06 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]
>>>>> "Vladimir" == Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> writes:
[..]
> As I already said: machtype isn't only about pmon. And I consider it
> as part of protocol on loongson so no, it won't be
> overrideable. Moreover it's fundamentally wrong to make bugs
> configurable (bugs=on). Please try the following patch: === modified
> file 'grub-core/loader/mips/linux.c' --- grub-core/loader/mips/linux.c
> 2011-08-19 20:46:11 +0000 +++ grub-core/loader/mips/linux.c 2011-10-30
> 03:28:36 +0000 @@ -41,7 +41,7 @@ const char loongson_machtypes[][60] =
> { [GRUB_ARCH_MACHINE_YEELOONG] =
> "machtype=lemote-yeeloong-2f-8.9inches", -
> [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-unknown",
> + [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-box",
> [GRUB_ARCH_MACHINE_FULOONG2E] = "machtype=lemote-fuloong-2e-unknown"
> }; #endif
Already have exactly that change applied to the version of grub installed.
$ cat /proc/cmdline
machtype=lemote-fuloong-2f-box root=/dev/mapper/world-root ro
console=tty rd_start=0x80eb0000 rd_size=0x68f0d9
$ cat /proc/cpuinfo |grep system
system type : lemote-fuloong-2f-box
cheers,
David
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-10-30 13:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-29 9:36 [bug] Wrong machtype argument passed for fuloong-2f David Kuehling
2011-10-29 10:37 ` Andreas Barth
2011-10-29 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-29 10:45 ` Andreas Barth
2011-10-29 10:54 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-29 13:56 ` Andreas Barth
2011-10-29 11:43 ` David Kuehling
2011-10-29 11:48 ` Andreas Barth
2011-10-29 20:46 ` David Kuehling
2011-10-29 20:54 ` Andreas Barth
2011-10-30 3:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-10-30 13:06 ` David Kuehling
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.