Received: from list by lists.gnu.org with archive (Exim 4.71) id 1dmga1-00044M-4m for mharc-grub-devel@gnu.org; Tue, 29 Aug 2017 09:29:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmgZy-000438-PT for grub-devel@gnu.org; Tue, 29 Aug 2017 09:29:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmgZs-0000GE-L9 for grub-devel@gnu.org; Tue, 29 Aug 2017 09:29:18 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46877) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmgZs-0000Fg-B6 for grub-devel@gnu.org; Tue, 29 Aug 2017 09:29:12 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7TDT9iW019939 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 13:29:09 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7TDT8B5027269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 13:29:09 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7TDT7v3028251; Tue, 29 Aug 2017 13:29:07 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Aug 2017 06:29:07 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 71F5E6A0764; Tue, 29 Aug 2017 09:29:06 -0400 (EDT) Date: Tue, 29 Aug 2017 09:29:06 -0400 From: Konrad Rzeszutek Wilk To: Fu Wei Fu Cc: daniel.kiper@oracle.com, xen-devel@lists.xenproject.org, The development of GNU GRUB Subject: Re: [PATCH 1/2] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 Message-ID: <20170829132905.GB32175@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: User-Agent: Mutt/1.8.3 (2017-05-23) X-Source-IP: userv0022.oracle.com [156.151.31.74] 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: Tue, 29 Aug 2017 13:29:20 -0000 On Tue, Aug 29, 2017 at 03:12:59PM +0800, Fu Wei Fu wrote: > Hi Konrad, > > Thanks for your feedback. Thank you for speedy response! > > On 29 August 2017 at 02:40, 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 your example > > > (For example on x86): > > + /usr/bin/grub2-file --is-arm64-efi /boot/xen-4.9.0.gz > > [root@tst063 grub]# echo $? > > 1 > > I guess that is right behavior, then > xen_loader="multiboot" > module_loader="module" > > /boot/xen-4.9.0.gz is a xen binary for x86, right? Correct. I also tested it with an xen.efi which was built for ARM (I copied it in /boot/ directroy), and it created an proper entry for it: xen_hypervisor /xen.efi placeholder dom0_max_vcpus=2 dom0_mem=max:2G loglvl=all guest_loglvl=all console=com1 com1=115200,8n1 iommu=verbose,debug scan=ucode conring_size=2097152 ${xen_rm_opts} en_module /vmlinuz-4.13.0-0.rc5.git1.1.fc27.x86_64 placeholder root=/dev/mapper/fedora_tst063-root ro rd.lvm.lv=fedora_tst063/root rd.lvm.lv=fedora_tst063/swap loglevel=8 console=hvc0 ... Naturally I didn't try to boot it as it would most surely not work. > > > > > will result in 20_linux_xen exciting without continuing > > and also causing grub2-mkconfig to stop processing. > > maybe we are using different shell? are you using ash? [root@tst063 fedora]# head -2 `which grub2-mkconfig` #! /bin/sh set -e And the upstream grub shows: [root@tst063 grub]# head -2 ./util/grub-mkconfig.in #! /bin/sh set -e I am assuming you are using ARM, in which case I would recommend you just copy xen.gz (compiled for x86) in your /boot directory. You should get a similar failure condition as I got. > > > > > 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 > > > > > > -- > Best regards, > > Fu Wei > Software Engineer > Red Hat