grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
@ 2014-10-22  8:23 Ian Campbell
  2014-10-22 13:17 ` Andrei Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-10-22  8:23 UTC (permalink / raw)
  To: grub-devel, xen-devel; +Cc: 759018, Ian Campbell

Upstream have defined a specification for where guests ought to place their
xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
loaded from dom0.

http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html

The spec calls for installation into /boot/xen/pvboot-i386.elf or
/boot/xen/pvboot-x86_64.elf.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
---
 util/grub-install.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/util/grub-install.c b/util/grub-install.c
index 70f514c..5f4d737 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1979,6 +1979,14 @@ main (int argc, char *argv[])
 	}
       break;
 
+    case GRUB_INSTALL_PLATFORM_I386_XEN:
+	  grub_install_copy_file (imgfile, "/boot/xen/pvboot-i386.elf", 1);
+	  break;
+
+    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
+	  grub_install_copy_file (imgfile, "/boot/xen/pvboot-x86_64.elf", 1);
+	  break;
+
     case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
     case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
     case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
@@ -1987,8 +1995,6 @@ main (int argc, char *argv[])
     case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
     case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
     case GRUB_INSTALL_PLATFORM_I386_QEMU:
-    case GRUB_INSTALL_PLATFORM_I386_XEN:
-    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
       grub_util_warn ("%s",
 		      _("WARNING: no platform-specific install was performed"));
       break;
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
  2014-10-22  8:23 [PATCH] grub-install: Install PV Xen binaries into the upstream specified path Ian Campbell
@ 2014-10-22 13:17 ` Andrei Borzenkov
  2014-10-22 13:37   ` [Xen-devel] " Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Borzenkov @ 2014-10-22 13:17 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: 759018, Ian Campbell, xen-devel@lists.xen.org

On Wed, Oct 22, 2014 at 12:23 PM, Ian Campbell <ijc@hellion.org.uk> wrote:
> Upstream have defined a specification for where guests ought to place their
> xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
> loaded from dom0.
>
> http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html
>
> The spec calls for installation into /boot/xen/pvboot-i386.elf or
> /boot/xen/pvboot-x86_64.elf.
>
> Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> ---
>  util/grub-install.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/util/grub-install.c b/util/grub-install.c
> index 70f514c..5f4d737 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -1979,6 +1979,14 @@ main (int argc, char *argv[])
>         }
>        break;
>
> +    case GRUB_INSTALL_PLATFORM_I386_XEN:
> +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-i386.elf", 1);
> +         break;
> +
> +    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-x86_64.elf", 1);
> +         break;
> +

What ensures that /boot/xen exists? Should grub-install create it?

>      case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
>      case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
>      case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
> @@ -1987,8 +1995,6 @@ main (int argc, char *argv[])
>      case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
>      case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
>      case GRUB_INSTALL_PLATFORM_I386_QEMU:
> -    case GRUB_INSTALL_PLATFORM_I386_XEN:
> -    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
>        grub_util_warn ("%s",
>                       _("WARNING: no platform-specific install was performed"));
>        break;
> --
> 2.1.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
  2014-10-22 13:17 ` Andrei Borzenkov
@ 2014-10-22 13:37   ` Ian Campbell
  2014-10-22 17:18     ` Andrei Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-10-22 13:37 UTC (permalink / raw)
  To: Andrei Borzenkov
  Cc: 759018, The development of GNU GRUB, xen-devel@lists.xen.org

On Wed, 2014-10-22 at 17:17 +0400, Andrei Borzenkov wrote:
> On Wed, Oct 22, 2014 at 12:23 PM, Ian Campbell <ijc@hellion.org.uk> wrote:
> > Upstream have defined a specification for where guests ought to place their
> > xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
> > loaded from dom0.
> >
> > http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html
> >
> > The spec calls for installation into /boot/xen/pvboot-i386.elf or
> > /boot/xen/pvboot-x86_64.elf.
> >
> > Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> > ---
> >  util/grub-install.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/util/grub-install.c b/util/grub-install.c
> > index 70f514c..5f4d737 100644
> > --- a/util/grub-install.c
> > +++ b/util/grub-install.c
> > @@ -1979,6 +1979,14 @@ main (int argc, char *argv[])
> >         }
> >        break;
> >
> > +    case GRUB_INSTALL_PLATFORM_I386_XEN:
> > +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-i386.elf", 1);
> > +         break;
> > +
> > +    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> > +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-x86_64.elf", 1);
> > +         break;
> > +
> 
> What ensures that /boot/xen exists? Should grub-install create it?

I expected it would just happen, but looking again only
grub_install_copy_files has this behaviour, not grub_install_copy_file. 

Should I add grub_install_mkdir_p in the hunks above, or should I be
thinking of patching grub_install_copy_file?

I've been testing this via the Debian packaging, which contains the
mkdir before it invokes grub-mkimage.

Ian.

> >      case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
> >      case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
> >      case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
> > @@ -1987,8 +1995,6 @@ main (int argc, char *argv[])
> >      case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
> >      case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
> >      case GRUB_INSTALL_PLATFORM_I386_QEMU:
> > -    case GRUB_INSTALL_PLATFORM_I386_XEN:
> > -    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> >        grub_util_warn ("%s",
> >                       _("WARNING: no platform-specific install was performed"));
> >        break;
> > --
> > 2.1.0
> >
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
  2014-10-22 13:37   ` [Xen-devel] " Ian Campbell
@ 2014-10-22 17:18     ` Andrei Borzenkov
  0 siblings, 0 replies; 4+ messages in thread
From: Andrei Borzenkov @ 2014-10-22 17:18 UTC (permalink / raw)
  To: Ian Campbell; +Cc: 759018, The development of GNU GRUB, xen-devel@lists.xen.org

В Wed, 22 Oct 2014 14:37:56 +0100
Ian Campbell <ijc@hellion.org.uk> пишет:

> On Wed, 2014-10-22 at 17:17 +0400, Andrei Borzenkov wrote:
> > On Wed, Oct 22, 2014 at 12:23 PM, Ian Campbell <ijc@hellion.org.uk> wrote:
> > > Upstream have defined a specification for where guests ought to place their
> > > xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
> > > loaded from dom0.
> > >
> > > http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html
> > >
> > > The spec calls for installation into /boot/xen/pvboot-i386.elf or
> > > /boot/xen/pvboot-x86_64.elf.
> > >
> > > Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> > > ---
> > >  util/grub-install.c | 10 ++++++++--
> > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/util/grub-install.c b/util/grub-install.c
> > > index 70f514c..5f4d737 100644
> > > --- a/util/grub-install.c
> > > +++ b/util/grub-install.c
> > > @@ -1979,6 +1979,14 @@ main (int argc, char *argv[])
> > >         }
> > >        break;
> > >
> > > +    case GRUB_INSTALL_PLATFORM_I386_XEN:
> > > +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-i386.elf", 1);
> > > +         break;
> > > +
> > > +    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> > > +         grub_install_copy_file (imgfile, "/boot/xen/pvboot-x86_64.elf", 1);
> > > +         break;
> > > +
> > 
> > What ensures that /boot/xen exists? Should grub-install create it?
> 
> I expected it would just happen, but looking again only
> grub_install_copy_files has this behaviour, not grub_install_copy_file. 
>

grub_install_copy_files is pretty misleading, it should really be named
grub_install_platform_files as this is the only thing it does.

> Should I add grub_install_mkdir_p in the hunks above, or should I be
> thinking of patching grub_install_copy_file?
> 

All other usages of grub_install_copy_file assume existing directory, so
I guess explicitly creating directory is fine.

Please do not use hardcoded absolute path names. It should respect
bootdir to facilitate offroot installation.

> I've been testing this via the Debian packaging, which contains the
> mkdir before it invokes grub-mkimage.
> 
> Ian.
> 
> > >      case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
> > >      case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
> > >      case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
> > > @@ -1987,8 +1995,6 @@ main (int argc, char *argv[])
> > >      case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
> > >      case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
> > >      case GRUB_INSTALL_PLATFORM_I386_QEMU:
> > > -    case GRUB_INSTALL_PLATFORM_I386_XEN:
> > > -    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> > >        grub_util_warn ("%s",
> > >                       _("WARNING: no platform-specific install was performed"));
> > >        break;
> > > --
> > > 2.1.0
> > >
> > >
> > > _______________________________________________
> > > Grub-devel mailing list
> > > Grub-devel@gnu.org
> > > https://lists.gnu.org/mailman/listinfo/grub-devel
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-22 17:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22  8:23 [PATCH] grub-install: Install PV Xen binaries into the upstream specified path Ian Campbell
2014-10-22 13:17 ` Andrei Borzenkov
2014-10-22 13:37   ` [Xen-devel] " Ian Campbell
2014-10-22 17:18     ` Andrei Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).