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.


--- 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
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to