All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Add hidden memdisk option to grub-install.
@ 2014-05-19  6:57 Glenn Washburn
  2014-06-02 14:42 ` Andrey Borzenkov
  0 siblings, 1 reply; 2+ messages in thread
From: Glenn Washburn @ 2014-05-19  6:57 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] Add hidden memdisk option to grub-install.
  2014-05-19  6:57 [PATCH 1/2] Add hidden memdisk option to grub-install Glenn Washburn
@ 2014-06-02 14:42 ` Andrey Borzenkov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Borzenkov @ 2014-06-02 14:42 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: development

В Mon, 19 May 2014 01:57:49 -0500
Glenn Washburn <development@efficientek.com> пишет:

> 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.

How exactly is it different from grub-mkstandalone? You can also add
custom config to it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-02 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19  6:57 [PATCH 1/2] Add hidden memdisk option to grub-install Glenn Washburn
2014-06-02 14:42 ` Andrey Borzenkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.