bc092b9
From 8eed7be8a61c295df700e918744a984162378ca9 Mon Sep 17 00:00:00 2001
bc092b9
From: Fu Wei <fu.wei@linaro.org>
bc092b9
Date: Sun, 14 May 2017 15:43:45 +0800
146faa5
Subject: [PATCH 039/229] arm64: Add "--nounzip" option support in xen_module
bc092b9
 command
bc092b9
bc092b9
This patch adds "--nounzip" option support in order to
bc092b9
be compatible with the module command of multiboot on other architecture,
bc092b9
by this way we can simplify grub-mkconfig support code.
bc092b9
bc092b9
This patch also allow us to use zip compressed module(like Linux kernel
bc092b9
for Dom0).
bc092b9
bc092b9
Signed-off-by: Fu Wei <fu.wei@linaro.org>
bc092b9
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bc092b9
---
bc092b9
 grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++
bc092b9
 1 file changed, 16 insertions(+)
bc092b9
bc092b9
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c
81987f4
index 8ae43d7e894..27ede46cac5 100644
bc092b9
--- a/grub-core/loader/arm64/xen_boot.c
bc092b9
+++ b/grub-core/loader/arm64/xen_boot.c
bc092b9
@@ -379,6 +379,20 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
bc092b9
 
bc092b9
   struct xen_boot_binary *module = NULL;
bc092b9
   grub_file_t file = 0;
bc092b9
+  int nounzip = 0;
bc092b9
+
bc092b9
+  if (!argc)
bc092b9
+    {
bc092b9
+      grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
bc092b9
+      goto fail;
bc092b9
+    }
bc092b9
+
bc092b9
+  if (grub_strcmp (argv[0], "--nounzip") == 0)
bc092b9
+    {
bc092b9
+      argv++;
bc092b9
+      argc--;
bc092b9
+      nounzip = 1;
bc092b9
+    }
bc092b9
 
bc092b9
   if (!argc)
bc092b9
     {
bc092b9
@@ -403,6 +417,8 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
bc092b9
 
bc092b9
   grub_dprintf ("xen_loader", "Init module and node info\n");
bc092b9
 
bc092b9
+  if (nounzip)
bc092b9
+    grub_file_filter_disable_compression ();
bc092b9
   file = grub_file_open (argv[0]);
bc092b9
   if (!file)
bc092b9
     goto fail;
bc092b9
-- 
81987f4
2.15.0
bc092b9