From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v16 4/9] x86: add multiboot2 protocol support for EFI platforms Date: Wed, 8 Mar 2017 11:46:37 -0500 Message-ID: <20170308164637.GC7367@char.us.oracle.com> References: <1487704799-21162-1-git-send-email-daniel.kiper@oracle.com> <1487704799-21162-5-git-send-email-daniel.kiper@oracle.com> <20170221192433.GA3484@olila.local.net-space.pl> <58ADA360020000780013CCBA@prv-mh.provo.novell.com> <20170222153421.GD3484@olila.local.net-space.pl> <20170306233904.GI29281@olila.local.net-space.pl> <20170308034414.GA25084@localhost.localdomain> <20170308141729.GC31053@olila.local.net-space.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clejp-000061-96 for xen-devel@lists.xenproject.org; Wed, 08 Mar 2017 16:46:57 +0000 Content-Disposition: inline In-Reply-To: <20170308141729.GC31053@olila.local.net-space.pl> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Daniel Kiper Cc: Juergen Gross , sstabellini@kernel.org, ning.sun@intel.com, andrew.cooper3@citrix.com, Doug Goldstein , pgnet.dev@gmail.com, julien.grall@arm.com, Jan Beulich , xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, gang.wei@intel.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ..snip.. > > Now in the process I discovered that my patch for grub-mkconfig to > > detect multiboot2 payloads and use those instead of multiboot never > > made it upstream, so I had to modify my grub.cfg by hand (see below). > > It will be nice if you post it after GRUB2 2.02 release. OK, I will wait (but attaching it here). --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch" >>From 89a85f31602f6d5f7355ffe6e246059e63cab973 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 8 Mar 2017 11:42:43 -0500 Subject: [PATCH] Use grub-file to figure out whether multiboot2 should be used for Xen.gz The multiboot2 is much more preferable than multiboot. Especially if booting under EFI where multiboot does not have the functionality to pass ImageHandler. Signed-off-by: Konrad Rzeszutek Wilk --- util/grub.d/20_linux_xen.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..7aae59f 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -85,6 +85,10 @@ linux_entry () type="$4" args="$5" xen_args="$6" + ver="" + if $($grub_file --is-x86-multiboot2 ${xen_dirname}/${xen_basename}); then + ver="2" + fi if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi @@ -122,16 +126,16 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi - multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} + multiboot${ver} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} echo '$(echo "$lmessage" | grub_quote)' - module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} + module${ver} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' - module --nounzip ${rel_dirname}/${initrd} + module${ver} --nounzip ${rel_dirname}/${initrd} EOF fi sed "s/^/$submenu_indentation/" << EOF -- 2.9.3 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --uAKRQypu60I7Lcqm--