grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org
Subject: [PATCH] Memdisk and embedded config options for grub-install
Date: Sun, 6 Nov 2011 01:30:53 -0500	[thread overview]
Message-ID: <4eb629a0.148eec0a.7af5.ffff8c24@mx.google.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Hi all,

I've attached a patch to grub-install which adds an extra option for
specifying a memdisk to install and an option to specify an embedded
config which will be appended to the already generated embedded config
(written to $prefix as load.cfg).  I don't really need the options to
be user visible, if that lowers the chance of the patch being
included.  But its nice to have these options when you want it.

Glenn

[-- Attachment #2: grub.specify-memdisk-at-install.patch --]
[-- Type: text/x-patch, Size: 1558 bytes --]

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2011-11-05 11:15:07 +0000
+++ util/grub-install.in	2011-11-05 23:38:45 +0000
@@ -54,6 +54,8 @@
 recheck=no
 debug=no
 debug_image=
+extra_config=
+memdisk=
 
 update_nvram=yes
 
@@ -107,6 +109,8 @@
   --no-floppy             do not probe any floppy drive
   --allow-floppy          Make the drive also bootable as floppy 
                           (default for fdX devices). May break on some BIOSes.
+  --extra-config=FILE     Append FILE to generated embedded config
+  --memdisk=FILE          add memdisk FILE to image
   --recheck               probe a device map even if it already exists
   --force                 install even if problems are detected
 EOF
@@ -249,6 +253,12 @@
     -f | --force)
         setup_force="--force" ;;
 
+    -c | --extra-config)
+        extra_config="`argument "$option" "$@"`"; shift;;
+
+    -m | --memdisk)
+        memdisk="`argument "$option" "$@"`"; shift;;
+
     -*)
 	echo "Unrecognized option \`$option'" 1>&2
 	usage
@@ -583,6 +593,15 @@
     prefix_drive=`"$grub_probe" --device-map="${device_map}" --target=drive --device "${grub_device}"` || exit 1
 fi
 
+if [ "x${extra_config}" != x ]; then
+    cat "${extra_config}" >> "${grubdir}/load.cfg"
+    config_opt="-c ${grubdir}/load.cfg "
+fi
+
+if [ "x${memdisk}" != x ]; then
+    config_opt="${config_opt} -m ${memdisk} "
+fi
+
 case "${target_cpu}-${platform}" in
     sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
     mipsel-loongson) mkimage_target=mipsel-loongson-elf ;;


             reply	other threads:[~2011-11-06  6:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06  6:30 Glenn Washburn [this message]
2011-11-06 19:31 ` [PATCH] Memdisk and embedded config options for grub-install Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4eb629a0.148eec0a.7af5.ffff8c24@mx.google.com \
    --to=development@efficientek.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).