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 Fu X-Patchwork-Id: 98401 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1740438qgf; Tue, 2 May 2017 00:07:06 -0700 (PDT) X-Received: by 10.36.233.66 with SMTP id f63mr1696406ith.46.1493708826165; Tue, 02 May 2017 00:07:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e196si16427066ioe.75.2017.05.02.00.07.05; Tue, 02 May 2017 00:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A640960F09; Tue, 2 May 2017 07:07:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id AE09F60D4E; Tue, 2 May 2017 07:07:02 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 70AD560CCA; Tue, 2 May 2017 07:07:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.linaro.org (Postfix) with ESMTPS id B83C660CCA for ; Tue, 2 May 2017 07:06:46 +0000 (UTC) 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, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org Subject: [Linaro-uefi] [PATCH v7 1/3] arm64: add "--nounzip" option support in xen_module command X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" 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;