Blame SOURCES/0071-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch

8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Peter Jones <pjones@redhat.com>
8e15ce
Date: Tue, 9 Jul 2019 14:31:19 +0200
8e15ce
Subject: [PATCH] 20_linux_xen: load xen or multiboot{,2} modules as needed.
8e15ce
8e15ce
Signed-off-by: Peter Jones <pjones@redhat.com>
8e15ce
---
8e15ce
 util/grub.d/20_linux_xen.in | 5 +++++
8e15ce
 1 file changed, 5 insertions(+)
8e15ce
8e15ce
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
8e15ce
index e9e73b815fb..c23b064be6c 100644
8e15ce
--- a/util/grub.d/20_linux_xen.in
8e15ce
+++ b/util/grub.d/20_linux_xen.in
8e15ce
@@ -153,6 +153,7 @@ linux_entry_xsm ()
8e15ce
         else
8e15ce
             xen_rm_opts="no-real-mode edd=off"
8e15ce
         fi
8e15ce
+	insmod ${xen_module}
8e15ce
 	${xen_loader}	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
8e15ce
 	echo	'$(echo "$lmessage" | grub_quote)'
8e15ce
 	${module_loader}	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
8e15ce
@@ -166,6 +167,7 @@ EOF
8e15ce
     done
8e15ce
     sed "s/^/$submenu_indentation/" << EOF
8e15ce
 	echo	'$(echo "$message" | grub_quote)'
8e15ce
+	insmod ${xen_module}
8e15ce
 	${module_loader}	--nounzip   $(echo $initrd_path)
8e15ce
 EOF
8e15ce
   fi
8e15ce
@@ -253,13 +255,16 @@ while [ "x${xen_list}" != "x" ] ; do
8e15ce
 	echo "	submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
8e15ce
     fi
8e15ce
     if ($grub_file --is-arm64-efi $current_xen); then
8e15ce
+	xen_module="xen_boot"
8e15ce
 	xen_loader="xen_hypervisor"
8e15ce
 	module_loader="xen_module"
8e15ce
     else
8e15ce
 	if ($grub_file --is-x86-multiboot2 $current_xen); then
8e15ce
+	    xen_module="multiboot2"
8e15ce
 	    xen_loader="multiboot2"
8e15ce
 	    module_loader="module2"
8e15ce
 	else
8e15ce
+	    xen_module="multiboot"
8e15ce
 	    xen_loader="multiboot"
8e15ce
 	    module_loader="module"
8e15ce
         fi