From patchwork Tue Aug 29 20:40:52 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: 9928271 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 7AC986022E for ; Tue, 29 Aug 2017 20:43:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C2F628A62 for ; Tue, 29 Aug 2017 20:43:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6012328A6A; Tue, 29 Aug 2017 20:43:41 +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 CF4EC28A62 for ; Tue, 29 Aug 2017 20:43:40 +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 1dmnJy-00055u-2N; Tue, 29 Aug 2017 20:41:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnJw-00055T-LM for xen-devel@lists.xenproject.org; Tue, 29 Aug 2017 20:41:12 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 2F/6F-03642-761D5A95; Tue, 29 Aug 2017 20:41:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsUyZ7p8oG76xaW RBhs/ilh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm3l3xiKngtXPHgzkrWBsZWwS5GLg4hgYlM Epe/P2CCcH4zSvS/O8kM4WxglGjt6WKHcLoZJV6dP8vaxcjBwSZgIvFmlWMXIyeHiEC4xN+j5 xlBbGYBP4newyvYQGxhgUSJbQ+vsYDYLAKqEuv2b2UHsXkFXCXez54KFpcQkJM4f/wnM4jNKe AmsWfxLiaQ8UJANX0rDCBKDCVOP9zGOIGRbwEjwypG9eLUorLUIl1zvaSizPSMktzEzBxdQwM zvdzU4uLE9NScxKRiveT83E2MwDBhAIIdjDMv+x9ilORgUhLljTi/NFKILyk/pTIjsTgjvqg0 J7X4EKMMB4eSBK/xBaCcYFFqempFWmYOMGBh0hIcPEoivEtA0rzFBYm5xZnpEKlTjIpS4rw6I AkBkERGaR5cGyxKLjHKSgnzMgIdIsRTkFqUm1mCKv+KUZyDUUmYNw5kCk9mXgnc9FdAi5mAFs d6gS0uSURISTUwsj7avkqz7nm252nT0G/7NnxY+Z+jcOkhTdZue4XyW/lGYd2xpbxrxY5ynFm wU/Bo9w2J4hUvEjoCbzWznea15Kx6XW23n7/yOXta1G2/wiLltKcTfrBaHudWd5/2x7Fp+cRb vEvmJjd8fjH3V+mfthTGLrcgXe1pWasWvpk33TrAU6593vl0JZbijERDLeai4kQAQiKyQ40CA AA= X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1504039269!73502770!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 30553 invoked from network); 29 Aug 2017 20:41:11 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Aug 2017 20:41:11 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7TKf5Eh021594 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 20:41:05 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v7TKf5op023063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 20:41:05 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v7TKf5fw023253; Tue, 29 Aug 2017 20:41:05 GMT Received: from osstest.dumpdata.com (/209.6.200.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Aug 2017 13:41:04 -0700 From: Konrad Rzeszutek Wilk To: daniel.kiper@oracle.com, xen-devel@lists.xenproject.org, grub-devel@gnu.org Date: Tue, 29 Aug 2017 16:40:52 -0400 Message-Id: <1504039253-3742-2-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1504039253-3742-1-git-send-email-konrad.wilk@oracle.com> References: <1504039253-3742-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Fu Wei , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 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 exiting without continuing and also causing grub2-mkconfig to stop processing. As in: [root@tst063 grub]# ./grub-mkconfig | tail Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.13.0-0.rc5.git1.1.fc27.x86_64 Found initrd image: /boot/initramfs-4.13.0-0.rc5.git1.1.fc27.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 Found initrd image: /boot/initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img echo 'Loading Linux 0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 ...' linux /vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 root=/dev/mapper/fedora_tst063-root ro single echo 'Loading initial ramdisk ...' initrd /initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img } } ### END /usr/local/etc/grub.d/10_linux ### ### BEGIN /usr/local/etc/grub.d/20_linux_xen ### root@tst063 grub]# 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 --- v1: Initial patch v2: Add the failing output. --- 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`