grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Memdisk and embedded config options for grub-install
@ 2011-11-06  6:30 Glenn Washburn
  2011-11-06 19:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Glenn Washburn @ 2011-11-06  6:30 UTC (permalink / raw)
  To: grub-devel

[-- 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 ;;


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

end of thread, other threads:[~2011-11-06 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06  6:30 [PATCH] Memdisk and embedded config options for grub-install Glenn Washburn
2011-11-06 19:31 ` Vladimir 'φ-coder/phcoder' Serbinenko

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