Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WmHWW-0006MM-7y for mharc-grub-devel@gnu.org; Mon, 19 May 2014 02:58:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmHWN-0006LK-W2 for grub-devel@gnu.org; Mon, 19 May 2014 02:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmHWG-0004xt-Ej for grub-devel@gnu.org; Mon, 19 May 2014 02:58:03 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:37247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmHWG-0004xi-8h for grub-devel@gnu.org; Mon, 19 May 2014 02:57:56 -0400 Received: by mail-pb0-f50.google.com with SMTP id ma3so5434353pbc.23 for ; Sun, 18 May 2014 23:57:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; bh=jIiyws9WEfDL4OoM7YcsDOqYS9J3XSq3oW+dHz4pspw=; b=Sc5k3UhuPwnO6P8lBUkraQNzHN5oZCPa1NfNcZzb3VIW90eTkdJVkzeIERrKLAagi5 4kt04oStZpPtsaFhf4pbmdnwlu8H/ZsPKv5tHmIvepFgZR5wunzEV0GaCOfLBxAwxg2T cZH3x/L3l9Hdl+75qICwXptxp5kTmVo198zefkPBmcUc2D6I0UyTn84Bu3RYW/+cAwRw TOFyqLNm9tQIMEJw3I0NNuS+PQVITxUwiTkuqxiGoU5PzRrZBCi5dr1cnfnD/pkqGaAe xA669xcG8mf9D87vVwIlnmdpEMre/R5eZMrwV8ONOxFXlnWcVdi6WnoTh5WJYF5ubGtN rdYA== X-Gm-Message-State: ALoCoQlBEY93DP1GQ+cU3x5OU92pFY3imY/CcYhQcoiOylio3RWJEpowfH2Pvi7x3jQ5K+jH3Edr X-Received: by 10.68.137.193 with SMTP id qk1mr37782046pbb.155.1400482674824; Sun, 18 May 2014 23:57:54 -0700 (PDT) Received: from crass-Ideapad-Z570 (cpe-70-117-77-21.austin.res.rr.com. [70.117.77.21]) by mx.google.com with ESMTPSA id cz3sm28249032pbc.9.2014.05.18.23.57.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 18 May 2014 23:57:54 -0700 (PDT) Date: Mon, 19 May 2014 01:57:49 -0500 From: Glenn Washburn To: grub-devel@gnu.org Subject: [PATCH 1/2] Add hidden memdisk option to grub-install. Message-ID: <20140519015749.05c3cc77@crass-Ideapad-Z570> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.20; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.160.50 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 06:58:11 -0000 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