From patchwork Sun May 14 07:43:45 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: 99757 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1038012qge; Sun, 14 May 2017 00:44:47 -0700 (PDT) X-Received: by 10.107.27.21 with SMTP id b21mr282804iob.65.1494747887401; Sun, 14 May 2017 00:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494747887; cv=none; d=google.com; s=arc-20160816; b=KozGPuvSN6sMguvQvz1ZDYESwIwUBCIGhbMlc+UI0V9To7b0mZxBGUJcRZa/PKs7xO Ad+tNXqTFHgOl2er5pqxp2zTt/MfVfXpmrekY1FIDL2u554ErRMD6FadVuezv+RBSbse JUJcKvBl5Uffm06Yb3AewvC+hPfi4x+7JxABfWU4R7QPUyEkOwf+6AvCEVjl2kxedbka en12u1W4Dz9OiQZVuw1FsnjR0M8WaNV8rLJ5K7uWrro/TLnWKyl5uLyxivSIouZEIDP6 OoL0qajXJvMD8J7E1tM9u+YiKt99/8pULuv4cX9bK3rRPNtGw0yCUXbC+tpmv0xtVJ4W 8KkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-filter:dmarc-filter:delivered-to :arc-authentication-results; bh=/rzRQz7FCupyLNMCCO40rWXCg5BIPGSzfI0GullJfPI=; b=myAFks1h/FZOA62e0wUFnrLxSfvqubAAFEzhMgFMNxIOIGcKgbUGcXm837O7LYIU23 0Qh5I30xBcu60VmvQPQ3L76emqZSUwDZsfOBDujdQG9niPZfiQ6lommi3ukXbmbalP3L nV+7s+/tSE3FzNMEXn4FqJdTi6ivdUwc/6xEPyQnFo4b/K5cDU9nSYlAi7SvJCBJKUrz luEpQBsmjzqYBorkoU44B4vX8Kbvtwr1Fh6s2vvB3noTcUY7oRRPBQubjW2gzLTz+/lB 8TGMeACknzSgJ1kAnVUxfImnvEw0YCSz4Z19pcKCIwwZdaidIL2C84MNx9RjhQPa4OO6 /leQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b8si7472657ioj.102.2017.05.14.00.44.47; Sun, 14 May 2017 00:44:47 -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 E3FAC60A3C; Sun, 14 May 2017 07:44:46 +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 F14E4608B6; Sun, 14 May 2017 07:44:41 +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 68A8760A34; Sun, 14 May 2017 07:44:39 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.linaro.org (Postfix) with ESMTPS id 4D0FB609E7 for ; Sun, 14 May 2017 07:44:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34DFF61BBB; Sun, 14 May 2017 07:44:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 34DFF61BBB DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 34DFF61BBB Received: from Rei-Ayanami.localdomain.com (vpn1-4-19.pek2.redhat.com [10.72.4.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 844B117140; Sun, 14 May 2017 07:44:13 +0000 (UTC) From: fu.wei@linaro.org To: dkiper@net-space.pl, grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Sun, 14 May 2017 15:43:45 +0800 Message-Id: <20170514074347.18787-2-fu.wei@linaro.org> In-Reply-To: <20170514074347.18787-1-fu.wei@linaro.org> References: <20170514074347.18787-1-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 14 May 2017 07:44:21 +0000 (UTC) Cc: xen-devel@lists.xensource.com, jcm@redhat.com, ian.campbell@docker.com, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org Subject: [Linaro-uefi] [PATCH v8 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: "For discussions about Linaro-related UEFI development. Not a substitute for edk2-devel." 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 for Dom0). Signed-off-by: Fu Wei --- grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..2a42654 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -379,6 +379,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 +417,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;