78e1a10
From 733966aa9d241a0987a7097eca74b0f58b426833 Mon Sep 17 00:00:00 2001
307d019
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
6f1e3d5
Date: Mon, 28 Aug 2017 13:51:14 -0400
78e1a10
Subject: [PATCH 194/216] Fix util/grub.d/20_linux_xen.in: Add xen_boot command
307d019
 support for aarch64
307d019
307d019
Commit d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe introduced
307d019
the support for this, but it does not work under x86 (as it stops
307d019
20_linux_xen from running).
307d019
307d019
The 20_linux_xen is run under a shell and any exits from within it:
307d019
307d019
(For example on x86):
307d019
+ /usr/bin/grub2-file --is-arm64-efi /boot/xen-4.9.0.gz
307d019
[root@tst063 grub]# echo $?
307d019
1
307d019
6f1e3d5
will result in 20_linux_xen exciting without continuing
307d019
and also causing grub2-mkconfig to stop processing.
307d019
307d019
As in:
307d019
6f1e3d5
[root@tst063 ~]#
307d019
307d019
And no more.
307d019
307d019
This patch wraps the invocation of grub-file to be a in subshell
307d019
and to process the return value in a conditional. That fixes
307d019
the issue.
307d019
307d019
RH-BZ 1486002: grub2-mkconfig does not work if xen.gz is installed.
307d019
CC: Fu Wei <fu.wei@linaro.org>
307d019
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
307d019
---
307d019
 util/grub.d/20_linux_xen.in | 9 ++++-----
307d019
 1 file changed, 4 insertions(+), 5 deletions(-)
307d019
307d019
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
ec4acbb
index 462f8e1f819..9b1bd716965 100644
307d019
--- a/util/grub.d/20_linux_xen.in
307d019
+++ b/util/grub.d/20_linux_xen.in
6f1e3d5
@@ -210,13 +210,12 @@ while [ "x${xen_list}" != "x" ] ; do
307d019
     if [ "x$is_top_level" != xtrue ]; then
307d019
 	echo "	submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
307d019
     fi
307d019
-    $grub_file --is-arm64-efi $current_xen
307d019
-    if [ $? -ne 0 ]; then
307d019
-	xen_loader="multiboot"
307d019
-	module_loader="module"
307d019
-    else
307d019
+    if ($grub_file --is-arm64-efi $current_xen); then
307d019
 	xen_loader="xen_hypervisor"
307d019
 	module_loader="xen_module"
307d019
+    else
307d019
+	xen_loader="multiboot"
307d019
+	module_loader="module"
307d019
     fi
307d019
     while [ "x$list" != "x" ] ; do
307d019
 	linux=`version_find_latest $list`
307d019
-- 
ec4acbb
2.15.0
307d019