Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JHpqO-0007iU-BL for mharc-grub-devel@gnu.org; Wed, 23 Jan 2008 19:21:24 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JHpqM-0007g5-7z for grub-devel@gnu.org; Wed, 23 Jan 2008 19:21:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JHpqK-0007d3-Fm for grub-devel@gnu.org; Wed, 23 Jan 2008 19:21:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHpqK-0007cf-9a for grub-devel@gnu.org; Wed, 23 Jan 2008 19:21:20 -0500 Received: from smtp8-g19.free.fr ([212.27.42.65]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JHpqJ-0007g1-QW for grub-devel@gnu.org; Wed, 23 Jan 2008 19:21:20 -0500 Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 0D90017F520 for ; Thu, 24 Jan 2008 01:21:19 +0100 (CET) Received: from [192.168.0.20] (klabs.be [82.224.65.140]) by smtp8-g19.free.fr (Postfix) with ESMTP id D5C1A17F51D for ; Thu, 24 Jan 2008 01:21:18 +0100 (CET) From: Franklin PIAT To: The development of GRUB 2 In-Reply-To: <20080123222609.GA29822@thorin> References: <1201124004.20596.24.camel@solid.paris.klabs.be> <20080123222609.GA29822@thorin> Content-Type: multipart/mixed; boundary="=-NKG0rW/VSqc7FmGdRDhb" Date: Thu, 24 Jan 2008 01:21:18 +0100 Message-Id: <1201134078.20596.61.camel@solid.paris.klabs.be> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: grub disk-image builder. 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: Thu, 24 Jan 2008 00:21:22 -0000 --=-NKG0rW/VSqc7FmGdRDhb Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2008-01-23 at 23:26 +0100, Robert Millan wrote: > On Wed, Jan 23, 2008 at 10:33:24PM +0100, Franklin PIAT wrote: > > Hello, > > > > For my personal needs, i've written a script to build floppy or > > hard-disk images. > > > > It's very similar to mkgrub-rescue.sh (and slightly based on it), > > except the images are formatted. Therefore it's possible to put > > a grub.cfg and splash images on it. > > It's already possible to put arbitrary files in grub-mkrescue. Is that > what you needed? > > If you find that something is missing in grub-mkrescue, I think it's better > to get it integrated in the same script rather than providing a collection > of utilities. I've just had a look at yesterday's commit, which introduces --overlay. great ! (Debian's Unstable is a few day behind cvs) Since I wanted to test splashscreen, I needed to put unicode.pff (1480KiB) + a tga image (1200KiB uncompressed)... That's why i came up with hard disk images. But now, with RLE'd TGA, JPEG and PNG, 2.88MiB floppy should do in most case (I haven't tested it). I've attached a patch for "--image-size" option. (it's GPL) The one feature that one could miss, is the ability to mount and modify the image, to easily customize rescue's grub.cfg, from a random Operating system that understand fat. -- I don't need that feature. Franklin > grub-mkrescue is only aimed at creating floppies (or CD images, although > we don't support that too well yet). For disks or disk-like media, grub-install > should work. Did you find any drawback or limitation in that method? It's > very useful for us that you tell us, since we can't think of every possible > use case. --=-NKG0rW/VSqc7FmGdRDhb Content-Disposition: attachment; filename=grub.diff Content-Type: text/x-patch; name=grub.diff; charset=utf-8 Content-Transfer-Encoding: 7bit --- grub-mkrescue.in?revision=1.5-orig 2008-01-24 01:01:13.000000000 +0100 +++ grub-mkrescue.in?revision=1.5 2008-01-24 01:08:35.000000000 +0100 @@ -46,6 +46,7 @@ --pkglibdir=DIR use images from directory DIR instead of ${pkglibdir} --grub-mkimage=FILE use FILE as grub-mkimage --image-type=TYPE select floppy or cdrom (default) + --image-size=1440 size of the image size (720, 1440 or 2880 KiB). grub-mkimage generates a bootable rescue image of the specified type. @@ -54,6 +55,7 @@ } image_type=cdrom +image_size=1440 input_dir=${pkglibdir} grub_mkimage=grub-mkimage @@ -82,6 +84,14 @@ echo "Unknown image type \`$image_type'" 1>&2 exit 1 ;; esac ;; + --image-size=*) + image_size=`echo "$option" | sed 's/--image-size=//'` + case "$image_size" in + 720|1440|2880) ;; + *) + echo "Invalid image size \`$image_size'" 1>&2 + exit 1 ;; + esac ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -125,7 +135,7 @@ core_img=`mktemp` ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules} rm -f ${memdisk_img} -cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $floppy_image +cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=${image_size} > $floppy_image rm -f ${core_img} if [ "x${image_type}" = "xfloppy" ] ; then --=-NKG0rW/VSqc7FmGdRDhb--