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
=== 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 ;;
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel