From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1dmOxm-0002rz-6G for mharc-grub-devel@gnu.org; Mon, 28 Aug 2017 14:40:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmOxk-0002rD-6c for grub-devel@gnu.org; Mon, 28 Aug 2017 14:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmOxg-0000pT-RG for grub-devel@gnu.org; Mon, 28 Aug 2017 14:40:40 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:26093) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmOxg-0000nJ-Ie for grub-devel@gnu.org; Mon, 28 Aug 2017 14:40:36 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7SIeWFI007866 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Aug 2017 18:40:33 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v7SIeWRj023263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Aug 2017 18:40:32 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v7SIeV5f023647; Mon, 28 Aug 2017 18:40:32 GMT Received: from osstest.dumpdata.com (/209.6.200.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Aug 2017 11:40:31 -0700 From: Konrad Rzeszutek Wilk To: daniel.kiper@oracle.com, xen-devel@lists.xenproject.org, grub-devel@gnu.org Cc: Konrad Rzeszutek Wilk , Fu Wei Subject: [PATCH 1/2] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 Date: Mon, 28 Aug 2017 14:40:14 -0400 Message-Id: <1503945615-1720-2-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1503945615-1720-1-git-send-email-konrad.wilk@oracle.com> References: <1503945615-1720-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2017 18:40:41 -0000 Commit d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe introduced the support for this, but it does not work under x86 (as it stops 20_linux_xen from running). The 20_linux_xen is run under a shell and any exits from within it: (For example on x86): + /usr/bin/grub2-file --is-arm64-efi /boot/xen-4.9.0.gz [root@tst063 grub]# echo $? 1 will result in 20_linux_xen exciting without continuing and also causing grub2-mkconfig to stop processing. As in: [root@tst063 ~]# And no more. This patch wraps the invocation of grub-file to be a in subshell and to process the return value in a conditional. That fixes the issue. RH-BZ 1486002: grub2-mkconfig does not work if xen.gz is installed. CC: Fu Wei Signed-off-by: Konrad Rzeszutek Wilk --- util/grub.d/20_linux_xen.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c002fc9..083bcef 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -206,13 +206,12 @@ while [ "x${xen_list}" != "x" ] ; do if [ "x$is_top_level" != xtrue ]; then echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" fi - $grub_file --is-arm64-efi $current_xen - if [ $? -ne 0 ]; then - xen_loader="multiboot" - module_loader="module" - else + if ($grub_file --is-arm64-efi $current_xen); then xen_loader="xen_hypervisor" module_loader="xen_module" + else + xen_loader="multiboot" + module_loader="module" fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` -- 2.1.4