[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] Add hidden memdisk option to grub-install.
From: |
Glenn Washburn |
Subject: |
[PATCH 1/2] Add hidden memdisk option to grub-install. |
Date: |
Mon, 19 May 2014 01:57:49 -0500 |
I have a set of scripts that I've been using with the old shell script
grub-install that creates its own memdisk and embedded config. Those options
are not available at present (I suspect partly intentionally). With this in
mind, I've added these options to grub-install, but left them as hidden
options. I'm not opposed to making them visible either.
---
util/grub-install.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/util/grub-install.c b/util/grub-install.c
index 7d61c32..d66030f 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -70,6 +70,7 @@ static int force = 0;
static int have_abstractions = 0;
static int have_cryptodisk = 0;
static char * bootloader_id;
+static char *memdisk = NULL;
static int have_load_cfg = 0;
static FILE * load_cfg_f = NULL;
static char *load_cfg;
@@ -98,6 +99,7 @@ enum
OPTION_REMOVABLE,
OPTION_BOOTLOADER_ID,
OPTION_EFI_DIRECTORY,
+ OPTION_MEMDISK,
OPTION_FONT,
OPTION_DEBUG,
OPTION_DEBUG_IMAGE,
@@ -181,6 +183,11 @@ argp_parser (int key, char *arg, struct argp_state *state)
efidir = xstrdup (arg);
return 0;
+ case OPTION_MEMDISK:
+ free (memdisk);
+ memdisk = xstrdup (arg);
+ return 0;
+
case OPTION_DISK_MODULE:
free (disk_module);
disk_module = xstrdup (arg);
@@ -256,6 +263,7 @@ static struct argp_option options[] = {
{"target", OPTION_TARGET, N_("TARGET"),
/* TRANSLATORS: "TARGET" as in "target platform". */
0, N_("install GRUB for TARGET platform [default=%s]; available targets:
%s"), 2},
+ {"memdisk", OPTION_MEMDISK, N_("FILE"), OPTION_HIDDEN, 0, 2},
{"grub-setup", OPTION_SETUP, "FILE", OPTION_HIDDEN, 0, 2},
{"grub-mkrelpath", OPTION_MKRELPATH, "FILE", OPTION_HIDDEN, 0, 2},
{"grub-mkdevicemap", OPTION_MKDEVICEMAP, "FILE", OPTION_HIDDEN, 0, 2},
@@ -1587,7 +1595,7 @@ main (int argc, char *argv[])
grub_install_make_image_wrap (/* source dir */
grub_install_source_directory,
/*prefix */ prefix,
/* output */ imgfile,
- /* memdisk */ NULL,
+ /* memdisk */ memdisk,
have_load_cfg ? load_cfg : NULL,
/* image target */ mkimage_target, 0);
/* Backward-compatibility kludges. */
@@ -1617,7 +1625,7 @@ main (int argc, char *argv[])
grub_install_make_image_wrap (/* source dir */
grub_install_source_directory,
/* prefix */ "",
/* output */ dst,
- /* memdisk */ NULL,
+ /* memdisk */ memdisk,
have_load_cfg ? load_cfg : NULL,
/* image target */ mkimage_target, 0);
}
--
1.8.3.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 1/2] Add hidden memdisk option to grub-install.,
Glenn Washburn <=