From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RMwFw-0008OI-E9 for mharc-grub-devel@gnu.org; Sun, 06 Nov 2011 01:31:00 -0500 Received: from eggs.gnu.org ([140.186.70.92]:40024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMwFu-0008OC-AU for grub-devel@gnu.org; Sun, 06 Nov 2011 01:30:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMwFt-0007Yw-B6 for grub-devel@gnu.org; Sun, 06 Nov 2011 01:30:58 -0500 Received: from mail-yw0-f41.google.com ([209.85.213.41]:42376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMwFt-0007Ys-8h for grub-devel@gnu.org; Sun, 06 Nov 2011 01:30:57 -0500 Received: by ywa17 with SMTP id 17so4650487ywa.0 for ; Sat, 05 Nov 2011 23:30:56 -0700 (PDT) Received: by 10.236.179.2 with SMTP id g2mr27874376yhm.27.1320561056757; Sat, 05 Nov 2011 23:30:56 -0700 (PDT) Received: from crass-z570.?null? (cpe-70-113-31-121.austin.res.rr.com. [70.113.31.121]) by mx.google.com with ESMTPS id h20sm22727966yhj.18.2011.11.05.23.30.55 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Nov 2011 23:30:56 -0700 (PDT) Date: Sun, 6 Nov 2011 01:30:53 -0500 From: Glenn Washburn To: grub-devel@gnu.org Subject: [PATCH] Memdisk and embedded config options for grub-install Message-ID: <4eb629a0.148eec0a.7af5.ffff8c24@mx.google.com> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/NowMlev8k3g8=yu9EVmR60L" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.41 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: Sun, 06 Nov 2011 06:30:59 -0000 --MP_/NowMlev8k3g8=yu9EVmR60L Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --MP_/NowMlev8k3g8=yu9EVmR60L Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=grub.specify-memdisk-at-install.patch === 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 ;; --MP_/NowMlev8k3g8=yu9EVmR60L--