[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] grub-mkconfig: Detect if Xen is multiboot2 and use appropiate module.



Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 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 de34c8d..ce91c1e 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -83,6 +83,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
@@ -120,16 +124,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.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.