Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LO1eg-0008Lt-G9 for mharc-grub-devel@gnu.org; Fri, 16 Jan 2009 22:15:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LO1ee-0008KG-Ii for grub-devel@gnu.org; Fri, 16 Jan 2009 22:15:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LO1ec-0008Hr-Tg for grub-devel@gnu.org; Fri, 16 Jan 2009 22:15:24 -0500 Received: from [199.232.76.173] (port=46990 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LO1ec-0008Ho-Nw for grub-devel@gnu.org; Fri, 16 Jan 2009 22:15:22 -0500 Received: from mail.dasr.de ([217.69.77.164]:2383) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LO1ec-0001Xq-D3 for grub-devel@gnu.org; Fri, 16 Jan 2009 22:15:22 -0500 Received: from c-24-91-125-189.hsd1.ma.comcast.net ([24.91.125.189] helo=plato.walfield.org.walfield.org) by mail.dasr.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1LO1e7-0000dV-Ma for grub-devel@gnu.org; Sat, 17 Jan 2009 04:14:51 +0100 Date: Sat, 17 Jan 2009 04:14:45 +0100 Message-ID: <87fxji62u2.wl%neal@walfield.org> From: "Neal H. Walfield" To: grub-devel@gnu.org User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.2 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: customizing grub-mkrecue images X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 03:15:25 -0000 Hi, grub-mkrescue is quite useful, however, I'd like to be able to customize the image it creates a bit more than it currently supports. In particular, I'd like to load another config file at boot time. The attached patch enables this by way of a new option, --configfile. A more general solution to the customization problem would be to load a config file at image compilation time. This could be used to solve my problem. However, as it is an additional level of indirection, perhaps both options would be useful. Thoughts? Thanks, Neal 2009-01-17 Neal H. Walfield * util/i386/pc/grub-mkrescue.in: Add new option --configfile. If not the set and not the empty string, load it from the generated config file on boot. Index: util/i386/pc/grub-mkrescue.in =================================================================== --- util/i386/pc/grub-mkrescue.in (revision 1946) +++ util/i386/pc/grub-mkrescue.in (working copy) @@ -49,6 +49,7 @@ --image-type=TYPE select floppy or cdrom (default) --emulation=TYPE select El Torito boot emulation type floppy or none (default) (cdrom only) + --configfile=FILE config file to load (default: none) grub-mkimage generates a bootable rescue image of the specified type. @@ -93,6 +94,9 @@ echo "Unknown emulation type \`$emulation'" 1>&2 exit 1 ;; esac ;; + --configfile=*) + configfile=`echo "$option" | sed 's/--configfile=//'` + ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -121,9 +125,15 @@ ${aux_dir}/boot/grub/ modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}" -for i in ${modules} ; do - echo "insmod $i" -done > ${aux_dir}/boot/grub/grub.cfg +{ + for i in ${modules} ; do + echo "insmod $i" + done + if test x$configfile != x + then + echo "configfile $configfile" + fi +} > ${aux_dir}/boot/grub/grub.cfg for d in ${overlay}; do echo "Overlaying $d"