From patchwork Tue May 10 14:03:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fu Wei Fu X-Patchwork-Id: 67454 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2146573qge; Tue, 10 May 2016 07:04:32 -0700 (PDT) X-Received: by 10.55.21.79 with SMTP id f76mr23540841qkh.92.1462889065528; Tue, 10 May 2016 07:04:25 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k65si1525192qgf.39.2016.05.10.07.04.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 10 May 2016 07:04:25 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b08Gu-0008Ps-Vl for patch@linaro.org; Tue, 10 May 2016 10:04:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b08Gl-0008CF-52 for grub-devel@gnu.org; Tue, 10 May 2016 10:04:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b08Ge-00062r-NQ for grub-devel@gnu.org; Tue, 10 May 2016 10:04:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b08Ge-00062n-HO for grub-devel@gnu.org; Tue, 10 May 2016 10:04:08 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA021C05B1CE; Tue, 10 May 2016 14:04:07 +0000 (UTC) Received: from magi-f23.redhat.com (vpn1-7-22.pek2.redhat.com [10.72.7.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4AE3p2O000415; Tue, 10 May 2016 10:04:04 -0400 From: fu.wei@linaro.org To: grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Subject: [PATCH v4 3/4] * util/grub.d/20_linux_xen.in: Add xen_boot command support Date: Tue, 10 May 2016 22:03:25 +0800 Message-Id: <1462889006-23671-4-git-send-email-fu.wei@linaro.org> In-Reply-To: <1462889006-23671-1-git-send-email-fu.wei@linaro.org> References: <1462889006-23671-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.32]); Tue, 10 May 2016 14:04:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 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: , Reply-To: The development of GNU GRUB 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 MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" From: Fu Wei This patch adds the support of xen_boot command: xen_hypervisor xen_module Also add a new "feature_xen_boot" to indicate this grub support xen_boot command. Signed-off-by: Fu Wei --- grub-core/normal/main.c | 2 +- util/grub.d/20_linux_xen.in | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) -- 2.5.5 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c index 78a70a8..3402a05 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -488,7 +488,7 @@ static const char *features[] = { "feature_chainloader_bpb", "feature_ntldr", "feature_platform_search_hint", "feature_default_font_path", "feature_all_video_module", "feature_menuentry_id", "feature_menuentry_options", "feature_200_final", - "feature_nativedisk_cmd", "feature_timeout_style" + "feature_nativedisk_cmd", "feature_timeout_style", "feature_xen_boot" }; GRUB_MOD_INIT(normal) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..6a88a39 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,23 @@ 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 [ "x\$feature_xen_boot" != xy ]; then + xen_loader="multiboot" + module_loader="module" + else + xen_loader="xen_hypervisor" + module_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} + \${module_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} + \${module_loader} --nounzip ${rel_dirname}/${initrd} EOF fi sed "s/^/$submenu_indentation/" << EOF