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@linaro.org X-Patchwork-Id: 9058231 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 1A6A0BF440 for ; Tue, 10 May 2016 14:06:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C69420154 for ; Tue, 10 May 2016 14:06:14 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 999E92014A for ; Tue, 10 May 2016 14:06:12 +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 1b08Gi-0006mC-IO; Tue, 10 May 2016 14:04:12 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b08Gh-0006lc-6E for xen-devel@lists.xensource.com; Tue, 10 May 2016 14:04:11 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id AE/1A-23864-A5AE1375; Tue, 10 May 2016 14:04:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRWlGSWpSXmKPExsVysWW7jG7kK8N wg7uTTS3uTXnP7sDosb1vF3sAYxRrZl5SfkUCa8aWBzuZC3qEKh58K21gnMffxcjJISSwl0ni 9F3PLkYuIPsEo8TerXNYQBJsAuISZzq/soLYIgJ2EncP7QSLMwscZ5S4/VsfxBYWCJa4fGQDe xcjBweLgKrE7e1eIGFeAUeJhc8/g5VzCjhJtDefZ4fY5SjxZPkVsLiEgLbE8wuT2UH2Sgj0MU q8ubORaQIjzwJGhlWM6sWpRWWpRbqGeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZs YgT5nAIIdjMs/Oh1ilORgUhLlFZxiGC7El5SfUpmRWJwRX1Sak1p8iFGGg0NJgnf2S6CcYFFq empFWmYOMPhg0hIcPEoivBkvgNK8xQWJucWZ6RCpU4yKUuK80iB9AiCJjNI8uDZYwF9ilJUS5 mUEOkSIpyC1KDezBFX+FaM4B6OSMK8lyBSezLwSuOmvgBYzAS2WY9MHWVySiJCSamC84525as bbxTK9go+K9zHrb2bmV15tOU060CNJv/L7kU6F/Mynb3YmKcdn2HAe+un6voOt1ujsCoGd/lq zzb/pOG1sPrRx9pM6ecawzOzG///3Wfi1rMwob9SPSr6oPPd5fJPkLGPtH8bZJ05XnlBefYT9 7bst9TrpmgUq8q3fDa4y7mLcxKfEUpyRaKjFXFScCADPqgKDcwIAAA== X-Env-Sender: fu.wei@linaro.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1462889048!39418663!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: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15855 invoked from network); 10 May 2016 14:04:09 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-14.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 10 May 2016 14:04:09 -0000 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 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) 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 v4 3/4] * util/grub.d/20_linux_xen.in: Add xen_boot command support 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-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 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(-) 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