On Sat, 11 Feb 2017, 19:45 Andrei Borzenkov <arvidj...@gmail.com> wrote:

> 11.02.2017 20:19, Andy Smith пишет:
> > Hello,
> >
> > On Sat, Feb 11, 2017 at 03:26:43PM +0000, Andy Smith wrote:
> >> Here is what the config looks like if I interrupt the boot and go to
> >> edit it:
> >>
> >> set root='(hd0,1)'; set legacy_hdbias='0'
> >> legacy_kernel   '/boot/vmlinuz-3.16.0-4-amd64'
> '/boot/vmlinuz-3.16.0-4-amd64'
> 'root=UUID=38420e46-6123-477d-ba23-baeba8ac0d59' 'ro'
> >> legacy_initrd '/boot/initrd.img-3.16.0-4-amd64'
> '/boot/initrd.img-3.16.0-4-amd64'
> >
> > Over on the xen-users list, Sarah Newman pointed out that the
> > legacy_initrd line should not have a repeated argument:
> >
> >
> https://lists.xenproject.org/archives/html/xen-users/2017-02/msg00029.html
> >
> > If I edit away the repetition, so that the config line is:
> >
> > legacy_initrd '/boot/initrd.img-3.16.0-4-amd64'
> >
> > then this boots fine.
> >
>
> This was explicitly added in commit
> 9fb175ed9a48102543867f8006842628cc41217c. I do not understand the
> purpose of this (is there any requirement that multiboot kernel/module
> gets its name as the first parameter?)
>
> @Vladimir? Either we need to revert this, or add similar handling to
> legacy_initrd, but I miss why we need it in the first place.
>
For multiboot module old grub was passing module file name on module
command line, so legacy_configfile should replicate this behaviour. But in
Linux case it shouldn't have ended up loading twice. We need additional
code in legacy_initrd. Please try the attached patch

>
> > Should I report this in grub's bugzilla?
> >
>
> Sure. Although I still wonder why it fails. I.e. kernel should simply
> extract the same initrd content twice, why it causes such effect?
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c
index dd9d9f1..24546bf 100644
--- a/grub-core/commands/legacycfg.c
+++ b/grub-core/commands/legacycfg.c
@@ -517,7 +517,7 @@ grub_cmd_legacy_initrd (struct grub_command *mycmd 
__attribute__ ((unused)),
 #endif
                           );
 
-      return cmd->func (cmd, argc, args);
+      return cmd->func (cmd, argc ? argc - 1 : 0, args + 1);
     }
   if (kernel_type == MULTIBOOT)
     {
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to