From patchwork Tue Jul 26 09:13:42 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: 9247947 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 76DA960757 for ; Tue, 26 Jul 2016 09:16:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6766426B39 for ; Tue, 26 Jul 2016 09:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B8F126C72; Tue, 26 Jul 2016 09:16:59 +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 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 D83BD26B39 for ; Tue, 26 Jul 2016 09:16:58 +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 1bRyRP-0001kc-GP; Tue, 26 Jul 2016 09:14:19 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRyRN-0001ji-UD for xen-devel@lists.xensource.com; Tue, 26 Jul 2016 09:14:18 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 98/AA-19721-9E927975; Tue, 26 Jul 2016 09:14:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysWW7jO4Lzen hBnMnaVvcm/Ke3YHRY3vfLvYAxijWzLyk/IoE1oyumVdYCxYKVTSt2cvSwDiPv4uRi0NIYC+T xIb7W5kgnLOMEhembWPuYuTkYBMQlzjT+ZUVxBYRsJO4e2gnC0gRs8ATRokvE78xgSSEBYIln vxvZOti5OBgEVCVuPo7HSTMK+Ag8e34N3YQm1PAUWLx8nlgM4WA4l3z/oPNlBDQlmiYNRlspo RAH6PEj0dPmScw8ixgZFjFqF6cWlSWWqRrqJdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5hUrJe cn7uJEej5egYGxh2MTb3OhxglOZiURHmZJkwLF+JLyk+pzEgszogvKs1JLT7EKMPBoSTBW6Qx PVxIsCg1PbUiLTMHGIIwaQkOHiUR3sUgad7igsTc4sx0iNQpRkUpcd4tIAkBkERGaR5cGyzsL zHKSgnzMjIwMAjxFKQW5WaWoMq/YhTnYFQS5q0HmcKTmVcCN/0V0GImoMULeCaDLC5JREhJNT AaPX9cGSUmsGbdvlOSkzN8q7N+PxGqOnLRM/uaW9++/TYdW1ZNz5mfprZspqfSxeW6Wdo3mhL 6mlTfWHVsbau6oz6NUXiupNaaxryQQ2k/WIQs357IWDOXsbWl4uDZ/9G59VmcvdwaHVeYHDhy rkuwz5f9snWX2JeqkIxNDbKZ17wUV/MdDlJiKc5INNRiLipOBABrUMxVdgIAAA== X-Env-Sender: fu.wei@linaro.org X-Msg-Ref: server-3.tower-206.messagelabs.com!1469524455!47726554!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.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55750 invoked from network); 26 Jul 2016 09:14:16 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Jul 2016 09:14:16 -0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 A487DC04D315; Tue, 26 Jul 2016 09:14:14 +0000 (UTC) Received: from rei-ayanami.redhat.com (vpn1-6-159.pek2.redhat.com [10.72.6.159]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6Q9Du0P028034; Tue, 26 Jul 2016 05:14:11 -0400 From: fu.wei@linaro.org To: grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Tue, 26 Jul 2016 17:13:42 +0800 Message-Id: <1469524423-7082-4-git-send-email-fu.wei@linaro.org> In-Reply-To: <1469524423-7082-1-git-send-email-fu.wei@linaro.org> References: <1469524423-7082-1-git-send-email-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 26 Jul 2016 09:14:14 +0000 (UTC) Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, jcm@redhat.com, leif.lindholm@linaro.org, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org, Fu Wei Subject: [Xen-devel] [PATCH v6 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-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..231e640 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