From patchwork Tue May 2 07:06:25 2017 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: 9707481 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 91ACC60245 for ; Tue, 2 May 2017 07:09:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82B772815E for ; Tue, 2 May 2017 07:09:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76FED283BA; Tue, 2 May 2017 07:09:11 +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 0BFF52815E for ; Tue, 2 May 2017 07:09:10 +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 1d5RtZ-0001f9-D1; Tue, 02 May 2017 07:06:49 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5RtY-0001f0-Jv for xen-devel@lists.xensource.com; Tue, 02 May 2017 07:06:48 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id EC/80-03920-80038095; Tue, 02 May 2017 07:06:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRWlGSWpSXmKPExsVysWW7jC67AUe kwcF3Khb3prxnd2D02N63iz2AMYo1My8pvyKBNaPn+iX2gsk8FasmWjQw/uPsYuTiEBKYwyQx 5/Q/9i5GTg4WAQeJvo7vLCA2o0CZxINNf9gh7GyJjft2sEHU2EusnziTDaJ5O6PE0SlnWEESb ALiEmc6v4LZIgJhEi/evwYrYha4zCjxaeJ2RpCEsECwxNOPF6AmqUr0Ns4B28ArYCbx58I3MJ tTwFxiZfc7sEFCQPFV234xg9gSAtoSDed/soIMlRDoY5TYefAn0wRGgQWMDKsYNYpTi8pSi3Q NDfSSijLTM0pyEzNzgDwzvdzU4uLE9NScxKRiveT83E2MwNBiAIIdjPeWBRxilORgUhLlVX/F HinEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgveVHkekkGBRanpqRVpmDjDIYdISHDxKIrys+kBp3 uKCxNzizHSI1ClGRSlx3pkgfQIgiYzSPLg2WGRdYpSVEuZlBDpEiKcgtSg3swRV/hWjOAejkj DvDZApPJl5JXDTXwEtZgJa3CwLtrgkESEl1cC4V3ThPadVO9WSeU64Nv9hSiqWOWCnnsbctZE l+O6J1hXf34amef/UP/7QLPKvn4haxrWw/92LvPRNp++9va/32MQNV3M+rFl6avfvN0INp2Ny a8xNzj9c+29X+sJ7U1ueBPnaelr7LWCUsvn9aPVUhg6NJulZKapfLr5bLX8n1V9ijSPj328Hl ViKMxINtZiLihMBJA4Iu6cCAAA= X-Env-Sender: fu.wei@linaro.org X-Msg-Ref: server-12.tower-21.messagelabs.com!1493708806!66189583!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: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6501 invoked from network); 2 May 2017 07:06:47 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 May 2017 07:06:47 -0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89B512DBB85; Tue, 2 May 2017 07:06:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89B512DBB85 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 89B512DBB85 Received: from Rei-Ayanami.localdomain.com (ovpn-8-44.pek2.redhat.com [10.72.8.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id B57E57D979; Tue, 2 May 2017 07:06:39 +0000 (UTC) From: fu.wei@linaro.org To: dkiper@net-space.pl, grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Tue, 2 May 2017 15:06:25 +0800 Message-Id: <20170502070627.11389-2-fu.wei@linaro.org> In-Reply-To: <20170502070627.11389-1-fu.wei@linaro.org> References: <20170502070627.11389-1-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 02 May 2017 07:06:46 +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 v7 1/3] arm64: add "--nounzip" option support in xen_module command 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 "--nounzip" option support in order to be compatible with the module command of multiboot on other architecture, by this way we can simplify grub-mkconfig support code. This patch also allow us to use zip compressed module(like Linux kernel "vmlinuz*" for Dom0). Signed-off-by: Fu Wei --- grub-core/loader/arm64/xen_boot.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..0878364 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -379,6 +380,20 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), struct xen_boot_binary *module = NULL; grub_file_t file = 0; + int nounzip = 0; + + if (!argc) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + goto fail; + } + + if (grub_strcmp (argv[0], "--nounzip") == 0) + { + argv++; + argc--; + nounzip = 1; + } if (!argc) { @@ -403,6 +418,8 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), grub_dprintf ("xen_loader", "Init module and node info\n"); + if (nounzip) + grub_file_filter_disable_compression (); file = grub_file_open (argv[0]); if (!file) goto fail;