From patchwork Mon Aug 28 18:40:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9926017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A28A60383 for ; Mon, 28 Aug 2017 18:43:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D0DD28794 for ; Mon, 28 Aug 2017 18:43:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11CC428790; Mon, 28 Aug 2017 18:43:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EDE82878F for ; Mon, 28 Aug 2017 18:42:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmOxl-0004BM-0o; Mon, 28 Aug 2017 18:40:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmOxk-0004Az-1y for xen-devel@lists.xenproject.org; Mon, 28 Aug 2017 18:40:40 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 82/D6-03406-7A364A95; Mon, 28 Aug 2017 18:40:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRWlGSWpSXmKPExsUyZ7p8oO7y5CW RBo2nuCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ox3x26wF+zgrTiz8gdrA+Nq7i5GLg4hgclM EvN6NjBCOH8ZJfZe2MUM4WxklLi5Zg0rhNPNKHF51hS2LkYODjYBE4k3qxy7GDk5RATCJf4eP c8IYjML+En0Hl7BBmILC8RJ3Hm3BsxmEVCVeNL9hxXE5hVwlTj/+RZYvYSAnMT54z+ZQWxOAT eJu3+PMIHYQkA1n/7tZYGoMZbom9XHMoGRbwEjwypGjeLUorLUIl1DA72kosz0jJLcxMwcIM9 MLze1uDgxPTUnMalYLzk/dxMjMFQYgGAH4/H3cYcYJTmYlER5d1YsjhTiS8pPqcxILM6ILyrN SS0+xCjDwaEkwVuatCRSSLAoNT21Ii0zBxi0MGkJDh4lEd54kDRvcUFibnFmOkTqFKOilDjv9 0SghABIIqM0D64NFimXGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMybCDKeJzOvBG76K6DFTE CLFQUXgiwuSURISTUwmj6PdWZ2ke1ZVB3a1cC1gLfSIEqsmVOO5WHyr61r/2aeNcr32/Lpmvb 5XUmLu/m3SHV+bGW5uHfO1/aN+3VOuS56fC9e4GRvnPJOHqly3c9Zi+N7eEVW95dULbjRdbw1 au+5JG8R7rfsl0Td7FfzXuIX83+5+dnPc0c+fPVcWGcye22U0h5xJZbijERDLeai4kQAZr+p/ o8CAAA= X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1503945637!90633146!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28133 invoked from network); 28 Aug 2017 18:40:38 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Aug 2017 18:40:38 -0000 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 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] Cc: Fu Wei , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH 1/2] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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`