From patchwork Tue Aug 29 20:40:53 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: 9928273 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 C5A08603B4 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 B80F028A62 for ; Tue, 29 Aug 2017 20:43:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACE1028A63; 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 4E58928A66 for ; Tue, 29 Aug 2017 20:43:41 +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-000565-94; Tue, 29 Aug 2017 20:41:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnJw-00055R-N2 for xen-devel@lists.xenproject.org; Tue, 29 Aug 2017 20:41:12 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 60/0E-02224-761D5A95; Tue, 29 Aug 2017 20:41:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42LpnVTnqpt2cWm kwfuPShbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aDvvOMBWc4Kh78vsHWwDiTvYuRi0NIYDKT xJ2Pq9ggnL+MEntXf2CFcDYwSjy+/wjK6WaUOLrsC2MXIwcHm4CJxJtVjl2MnBwiAuESf4+eZ wSxmQWMJCY3vmMBsYUFEiQu3lnPBGKzCKhKtJ//xwTSyivgKrHhZAhIWEJATuL88Z/MIDangJ vEnsW7wEqEgEr6VhhAlBhLtL+9yDaBkW8BI8MqRo3i1KKy1CJdIyO9pKLM9IyS3MTMHF1DA2O 93NTi4sT01JzEpGK95PzcTYzAMKlnYGDcwTj1hN8hRkkOJiVRXrsLSyOF+JLyUyozEosz4otK c1KLDzHKcHAoSfAag+QEi1LTUyvSMnOAAQuTluDgURLhtTgPlOYtLkjMLc5Mh0idYtTl2LB6/ RcmIZa8/LxUKXFeHZAZAiBFGaV5cCNg0XOJUVZKmJeRgYFBiKcgtSg3swRV/hWjOAejkjCvGs gUnsy8ErhNr4COYAI6ItYL7IiSRISUVAOj17H+7gAl/UnWRjyzovw0DZs3NZ8+x9R1IbLdNn/ pe+6ebN/WUEm/lzcnTd1m/2GqXojQ+Qnb1+uzae2UW3mrIFD7gJDWO+3MrDvn5324rZt4PVN9 rcarJJOC54GRDPOXvq0vv/2y5k+s/sYH1xd73/J58O6y3OKdPTo1XUtyi+49jHjb2BWixFKck WioxVxUnAgAWkUwxJkCAAA= X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1504039269!111493479!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18629 invoked from network); 29 Aug 2017 20:41:10 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-10.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Aug 2017 20:41:10 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7TKf6NR009835 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 20:41:06 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7TKf6oO007641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 20:41:06 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7TKf5GM006928; Tue, 29 Aug 2017 20:41:06 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:05 -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:53 -0400 Message-Id: <1504039253-3742-3-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: aserv0022.oracle.com [141.146.126.234] Cc: Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 2/2] Use grub-file to figure out whether multiboot2 should be used for Xen.gz 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 The multiboot2 is much more preferable than multiboot. Especiall if booting under EFI where multiboot does not have the functionality to pass ImageHandler. Signed-off-by: Konrad Rzeszutek Wilk --- v2: Rebase on top of d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe v3: Add 'else' in the conditional. Use a tab and four spaces instead of two tabs. --- util/grub.d/20_linux_xen.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 083bcef..0cb0f4e 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -210,8 +210,13 @@ while [ "x${xen_list}" != "x" ] ; do xen_loader="xen_hypervisor" module_loader="xen_module" else - xen_loader="multiboot" - module_loader="module" + if ($grub_file --is-x86-multiboot2 $current_xen); then + xen_loader="multiboot2" + module_loader="module2" + else + xen_loader="multiboot" + module_loader="module" + fi fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list`