Bug#759018: [PATCH RFC] Provide prebuilt grub-xen binaries for host (dom0) use
Ian Campbell
ijc at hellion.org.uk
Sun Aug 24 21:42:37 UTC 2014
On Sat, 2014-08-23 at 21:38 +0100, Ian Campbell wrote:
(Context for new CC: I'd like to provide a Debian package for dom0 which
includes pvgrub2 binaries which can be referenced from your domain cfg
files as the bootloader/kernel. The associated Debian wishlist bug is
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759018)
> diff --git a/debian/grub-xen-host_grub.cfg
> b/debian/grub-xen-host_grub.cfg
> new file mode 100644
> index 0000000..1ad895c
> --- /dev/null
> +++ b/debian/grub-xen-host_grub.cfg
> @@ -0,0 +1,25 @@
> +# First search for a suitable grub to chainload
> +search -s -f /boot/grub/@@TARGET@@/core.elf
> +if multiboot /boot/grub/@@TARGET@@/core.elf ; then
> + echo "Chainloading (${root})/boot/grub/@@TARGET@@/core.elf"
> + boot
> +fi
> +
> +search -s -f /grub/@@TARGET@@/core.elf
> +if multiboot /grub/@@TARGET@@/core.elf ; then
> + echo "Chainloading (${root})/grub/@@TARGET@@/core.elf"
> + boot
> +fi
[...]
> diff --git a/debian/rules b/debian/rules
> index f478e94..18f4776 100755
> --- a/debian/rules
> +++ b/debian/rules
> [...]
> +debian/stamps/build-grub-xen-host-i386: GRUB_TARGET := i386-xen
> +debian/stamps/build-grub-xen-host-amd64: GRUB_TARGET := x86_64-xen
> [...]
> + sed -e "s/@@TARGET@@/$(GRUB_TARGET)/g" \
The net result of the above is that the dom0 core.img built by the
package will search /boot/grub/{i386,x86_64}-xen/core.elf (for the arch
matching itself only) and then the version without the /boot prefix (for
systems with separate /boot).
Colin mentioned at debconf that it would be good if these paths were
standard across all distros -- probably this is best treated as
something which upstream Xen specifies a standard on, so CCing xen-devel
and Ian J who has previously been involved with these conversations. I'm
not sure what the best way to promulgate the spec is -- I think a patch
to add xen.git/docs/misc/pvgrub2.markdown would be sufficient (it would
end up under http://xenbits.xen.org/docs/).
Other alternatives for the paths might be things in the /boot/xen
"namespace" rather than /boot/grub, I don't mind which so long as it is
decided. Unless someone has a strong preference I'm inclined to go with
the paths as they happen to be in the patch above.
Ian.
More information about the Pkg-grub-devel
mailing list