* [PATCH v2] grub-install: Install PV Xen binaries into the upstream specified path
@ 2014-10-23 21:28 Ian Campbell
2015-03-27 15:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2014-10-23 21:28 UTC (permalink / raw)
To: grub-devel, xen-devel; +Cc: 759018, Andrei Borzenkov, 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>
---
v2: Respect bootdir, create /boot/xen as needed.
---
util/grub-install.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/util/grub-install.c b/util/grub-install.c
index 70f514c..7a7734e 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1979,6 +1979,28 @@ main (int argc, char *argv[])
}
break;
+ case GRUB_INSTALL_PLATFORM_I386_XEN:
+ {
+ char *path = grub_util_path_concat (2, bootdir, "xen");
+ char *dst = grub_util_path_concat (2, path, "pvboot-i386.elf");
+ grub_install_mkdir_p (path);
+ grub_install_copy_file (imgfile, dst, 1);
+ free (dst);
+ free (path);
+ }
+ break;
+
+ case GRUB_INSTALL_PLATFORM_X86_64_XEN:
+ {
+ char *path = grub_util_path_concat (2, bootdir, "xen");
+ char *dst = grub_util_path_concat (2, path, "pvboot-x86_64.elf");
+ grub_install_mkdir_p (path);
+ grub_install_copy_file (imgfile, dst, 1);
+ free (dst);
+ free (path);
+ }
+ break;
+
case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
@@ -1987,8 +2009,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] 3+ messages in thread
* Re: [PATCH v2] grub-install: Install PV Xen binaries into the upstream specified path
2014-10-23 21:28 [PATCH v2] grub-install: Install PV Xen binaries into the upstream specified path Ian Campbell
@ 2015-03-27 15:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-05-13 3:43 ` Andrei Borzenkov
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2015-03-27 15:40 UTC (permalink / raw)
To: The development of GNU GRUB
On 23.10.2014 23:28, Ian Campbell 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>
>
> ---
> v2: Respect bootdir, create /boot/xen as needed.
> ---
> util/grub-install.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/util/grub-install.c b/util/grub-install.c
> index 70f514c..7a7734e 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -1979,6 +1979,28 @@ main (int argc, char *argv[])
> }
> break;
>
> + case GRUB_INSTALL_PLATFORM_I386_XEN:
> + {
> + char *path = grub_util_path_concat (2, bootdir, "xen");
> + char *dst = grub_util_path_concat (2, path, "pvboot-i386.elf");
> + grub_install_mkdir_p (path);
> + grub_install_copy_file (imgfile, dst, 1);
> + free (dst);
> + free (path);
> + }
> + break;
> +
> + case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> + {
> + char *path = grub_util_path_concat (2, bootdir, "xen");
Bootdir is not necessarily /boot. We also might want to specify xen dir
to e.g. /mnt/ext2/boot/xen while still keeping GRUB itself in
/boot/grub. Can you update patch to allow separate specification of
bootdir and xendir?
> + char *dst = grub_util_path_concat (2, path, "pvboot-x86_64.elf");
> + grub_install_mkdir_p (path);
> + grub_install_copy_file (imgfile, dst, 1);
> + free (dst);
> + free (path);
> + }
> + break;
> +
> case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
> case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
> case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
> @@ -1987,8 +2009,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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] grub-install: Install PV Xen binaries into the upstream specified path
2015-03-27 15:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2015-05-13 3:43 ` Andrei Borzenkov
0 siblings, 0 replies; 3+ messages in thread
From: Andrei Borzenkov @ 2015-05-13 3:43 UTC (permalink / raw)
To: The development of GNU GRUB
В Fri, 27 Mar 2015 16:40:14 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> On 23.10.2014 23:28, Ian Campbell 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>
> >
> > ---
> > v2: Respect bootdir, create /boot/xen as needed.
> > ---
> > util/grub-install.c | 24 ++++++++++++++++++++++--
> > 1 file changed, 22 insertions(+), 2 deletions(-)
> >
> > diff --git a/util/grub-install.c b/util/grub-install.c
> > index 70f514c..7a7734e 100644
> > --- a/util/grub-install.c
> > +++ b/util/grub-install.c
> > @@ -1979,6 +1979,28 @@ main (int argc, char *argv[])
> > }
> > break;
> >
> > + case GRUB_INSTALL_PLATFORM_I386_XEN:
> > + {
> > + char *path = grub_util_path_concat (2, bootdir, "xen");
> > + char *dst = grub_util_path_concat (2, path, "pvboot-i386.elf");
> > + grub_install_mkdir_p (path);
> > + grub_install_copy_file (imgfile, dst, 1);
> > + free (dst);
> > + free (path);
> > + }
> > + break;
> > +
> > + case GRUB_INSTALL_PLATFORM_X86_64_XEN:
> > + {
> > + char *path = grub_util_path_concat (2, bootdir, "xen");
> Bootdir is not necessarily /boot. We also might want to specify xen dir
> to e.g. /mnt/ext2/boot/xen while still keeping GRUB itself in
> /boot/grub. Can you update patch to allow separate specification of
> bootdir and xendir?
I think similar to --efi-directory it has to refer to mount point, not
to final destination; --xen-directory=/mnt will install
into /mnt/boot/xen. We do not have control over /boot/xen part.
It also means that grub-install needs to strip off relative path off
bootdir to build xendir on the same filesystem to get sane default.
> > + char *dst = grub_util_path_concat (2, path, "pvboot-x86_64.elf");
> > + grub_install_mkdir_p (path);
> > + grub_install_copy_file (imgfile, dst, 1);
> > + free (dst);
> > + free (path);
> > + }
> > + break;
> > +
> > case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
> > case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
> > case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
> > @@ -1987,8 +2009,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;
> >
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-13 3:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-23 21:28 [PATCH v2] grub-install: Install PV Xen binaries into the upstream specified path Ian Campbell
2015-03-27 15:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-05-13 3:43 ` 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).