From patchwork Wed Feb 24 18:01:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fu.wei@linaro.org X-Patchwork-Id: 8410871 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72D7BC0553 for ; Wed, 24 Feb 2016 18:04:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C0C820361 for ; Wed, 24 Feb 2016 18:04:56 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA4C520270 for ; Wed, 24 Feb 2016 18:04:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYdlV-0006cu-LL; Wed, 24 Feb 2016 18:02:21 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYdlU-0006cL-2m for xen-devel@lists.xensource.com; Wed, 24 Feb 2016 18:02:20 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id CE/79-03519-B20FDC65; Wed, 24 Feb 2016 18:02:19 +0000 X-Env-Sender: fu.wei@linaro.org X-Msg-Ref: server-9.tower-206.messagelabs.com!1456336937!24780083!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 56129 invoked from network); 24 Feb 2016 18:02:18 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Feb 2016 18:02:18 -0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4AA6A627C1; Wed, 24 Feb 2016 18:02:17 +0000 (UTC) Received: from magi-f22.redhat.com (vpn1-5-9.pek2.redhat.com [10.72.5.9]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OI1o57031440; Wed, 24 Feb 2016 13:02:09 -0500 From: fu.wei@linaro.org To: grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Thu, 25 Feb 2016 02:01:40 +0800 Message-Id: <1456336901-25708-3-git-send-email-fu.wei@linaro.org> In-Reply-To: <1456336901-25708-1-git-send-email-fu.wei@linaro.org> References: <1456336901-25708-1-git-send-email-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 24 Feb 2016 18:02:17 +0000 (UTC) Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, jcm@redhat.com, julien.grall@linaro.org, leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, Fu Wei Subject: [Xen-devel] [PATCH 2/3] * util/grub.d/20_linux_xen.in: Add support of the xen_boot command X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fu Wei This patch adds the support of xen_boot command: xen_hypervisor xen_module Signed-off-by: Fu Wei --- util/grub.d/20_linux_xen.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 46045db..f2a7e95 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,28 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi - multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} + if [ -f \$prefix/\$grub_cpu-\$grub_platform/xen_boot.mod ]; then + insmod xen_boot + fi + if [ "x\$grub_xen_boot" != xy ]; then + xen_loader="multiboot" + linux_loader="module" + initrd_loader="module --nounzip" + else + xen_loader="xen_hypervisor" + linux_loader="xen_module" + initrd_loader="xen_module" + fi + \${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} echo '$(echo "$lmessage" | grub_quote)' - module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} + \${linux_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' - module --nounzip ${rel_dirname}/${initrd} + \${initrd_loader} ${rel_dirname}/${initrd} EOF fi sed "s/^/$submenu_indentation/" << EOF