[PATCH] grub-install: Install PV Xen binaries into the upstream specified path
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 --- 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 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
On Wed, Oct 22, 2014 at 12:23 PM, 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 > --- > 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 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [Xen-devel] [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
On Wed, 2014-10-22 at 17:17 +0400, Andrei Borzenkov wrote: > On Wed, Oct 22, 2014 at 12:23 PM, 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 > > --- > > 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-de...@lists.xen.org > http://lists.xen.org/xen-devel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Patch to support GELI passphrase passthrough
Hey, just a small patch to submit today. If you rather I send this to the bug tracker then I can do that also. This patch allows exporting the FreeBSD GELI passphrase to the kernel environment, which we will be doing in PC-BSD to avoid prompting for the passphrase a second time at bootup. Let me know if you have any suggestions or need any changes. I'm currently hacking on support for EFI framebuffer settings to be passed to FreeBSD kernel as well, will send patches once I get things working there. -- Kris Moore PC-BSD Software iXsystems --- grub-core/disk/geli.c.orig 2014-05-15 14:00:10.0 -0400 +++ grub-core/disk/geli.c 2014-09-26 10:18:53.325111693 -0400 @@ -430,6 +430,9 @@ if (!grub_password_get (passphrase, MAX_PASSPHRASE)) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); + /* Set the GELI passphrase to GRUB env, for passing to FreeBSD kernel */ + grub_env_set ("gelipassphrase", passphrase); + /* Calculate the PBKDF2 of the user supplied passphrase. */ if (grub_le_to_cpu32 (header.niter) != 0) { ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [Xen-devel] [PATCH] grub-install: Install PV Xen binaries into the upstream specified path
В Wed, 22 Oct 2014 14:37:56 +0100 Ian Campbell пишет: > On Wed, 2014-10-22 at 17:17 +0400, Andrei Borzenkov wrote: > > On Wed, Oct 22, 2014 at 12:23 PM, 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 > > > --- > > > 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-de...@lists.xen.org > > http://lists.xen.org/xen-devel > > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Patch to support GELI passphrase passthrough
В Wed, 22 Oct 2014 13:12:32 -0400 Kris Moore пишет: > > > Hey, just a small patch to submit today. If you rather I send this to > the bug tracker then I can do that also. > > This patch allows exporting the FreeBSD GELI passphrase to the kernel > environment, which we will be doing in PC-BSD to avoid prompting for the > passphrase a second time at bootup. > >if (!grub_password_get (passphrase, MAX_PASSPHRASE)) > return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); > > + /* Set the GELI passphrase to GRUB env, for passing to FreeBSD kernel */ > + grub_env_set ("gelipassphrase", passphrase); > + If I read BSD loader correctly, this should be kFreeBSD.gelipassphrase. Is geli freebsd-specific? >/* Calculate the PBKDF2 of the user supplied passphrase. */ >if (grub_le_to_cpu32 (header.niter) != 0) > { It sounds more logical to export it after it has been verified? I tried to find out about this "gelipassphrase" kernel variable but did not find anything. Is it already used anywhere? > Let me know if you have any suggestions or need any changes. I'm > currently hacking on support for EFI framebuffer settings to be passed > to FreeBSD kernel as well, will send patches once I get things working > there. > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Patch to support GELI passphrase passthrough
On 10/22/2014 13:47, Andrei Borzenkov wrote: > В Wed, 22 Oct 2014 13:12:32 -0400 > Kris Moore пишет: > >> >> Hey, just a small patch to submit today. If you rather I send this to >> the bug tracker then I can do that also. >> >> This patch allows exporting the FreeBSD GELI passphrase to the kernel >> environment, which we will be doing in PC-BSD to avoid prompting for the >> passphrase a second time at bootup. >> >>if (!grub_password_get (passphrase, MAX_PASSPHRASE)) >> return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); >> >> + /* Set the GELI passphrase to GRUB env, for passing to FreeBSD kernel */ >> + grub_env_set ("gelipassphrase", passphrase); >> + > If I read BSD loader correctly, this should be kFreeBSD.gelipassphrase. > Is geli freebsd-specific? > >>/* Calculate the PBKDF2 of the user supplied passphrase. */ >>if (grub_le_to_cpu32 (header.niter) != 0) >> { > It sounds more logical to export it after it has been verified? > > I tried to find out about this "gelipassphrase" kernel variable but did > not find anything. Is it already used anywhere? > >> Let me know if you have any suggestions or need any changes. I'm >> currently hacking on support for EFI framebuffer settings to be passed >> to FreeBSD kernel as well, will send patches once I get things working >> there. >> > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel Well, this patch just makes the variable available to grub.cfg file, then we do some stuff there like this: set kFreeBSD.kern.geom.eli.passphrase= The patch for support in FreeBSD should be in HEAD soon, but here it is if you want to take a look: https://github.com/pcbsd/freebsd/commit/79f4efcf6a7d4268781adc227d76ed9f7f0b685d -- Kris Moore PC-BSD Software iXsystems ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel