From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1dmOzU-00049i-Mq for mharc-grub-devel@gnu.org; Mon, 28 Aug 2017 14:42:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmOzR-000486-N8 for grub-devel@gnu.org; Mon, 28 Aug 2017 14:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmOzO-0002A5-JV for grub-devel@gnu.org; Mon, 28 Aug 2017 14:42:25 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmOzO-00029R-AN for grub-devel@gnu.org; Mon, 28 Aug 2017 14:42:22 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7SIgK96018587 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Aug 2017 18:42:20 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v7SIgKq3001445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Aug 2017 18:42:20 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7SIgJkx000428; Mon, 28 Aug 2017 18:42:19 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Aug 2017 11:42:19 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 9B8356A0764; Mon, 28 Aug 2017 14:42:18 -0400 (EDT) Date: Mon, 28 Aug 2017 14:42:18 -0400 From: Konrad Rzeszutek Wilk To: daniel.kiper@oracle.com, xen-devel@lists.xenproject.org, grub-devel@gnu.org Cc: Fu Wei Subject: Re: [PATCH 1/2] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 Message-ID: <20170828184218.GA28293@char.us.oracle.com> References: <1503945615-1720-1-git-send-email-konrad.wilk@oracle.com> <1503945615-1720-2-git-send-email-konrad.wilk@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1503945615-1720-2-git-send-email-konrad.wilk@oracle.com> User-Agent: Mutt/1.8.3 (2017-05-23) 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: 141.146.126.69 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:42:26 -0000 On Mon, Aug 28, 2017 at 02:40:14PM -0400, Konrad Rzeszutek Wilk wrote: > 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: git format-patch decided to eat this relevant part: [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]# > > [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 >