* loader/multiboot.c (grub_cmd_module): Don't unzip module if

--nounzip is passed.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-21 00:57:12 +02:00
parent 05a765c88b
commit dee5057594
2 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2010-08-21 Vladimir Serbinenko <phcoder@gmail.com>
* loader/multiboot.c (grub_cmd_module): Don't unzip module if
--nounzip is passed.
2010-08-20 Vladimir Serbinenko <phcoder@gmail.com>
USB hotunplugging and USB serial support.

View file

@ -295,6 +295,17 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
grub_ssize_t size;
char *module = 0;
grub_err_t err;
int nounzip = 0;
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
if (grub_strcmp (argv[0], "--nounzip") == 0)
{
argv++;
argc--;
nounzip = 1;
}
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
@ -303,6 +314,9 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"you need to load the multiboot kernel first");
if (nounzip)
file = grub_file_open (argv[0]);
else
file = grub_gzfile_open (argv[0], 1);
if (! file)
return grub_errno;