* Re: grub disk-image builder.
2008-01-23 22:26 ` Robert Millan
@ 2008-01-24 0:21 ` Franklin PIAT
2008-01-24 12:07 ` Robert Millan
2008-01-24 10:19 ` Marco Gerards
1 sibling, 1 reply; 5+ messages in thread
From: Franklin PIAT @ 2008-01-24 0:21 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]
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.
[-- Attachment #2: grub.diff --]
[-- Type: text/x-patch, Size: 1464 bytes --]
--- 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: grub disk-image builder.
2008-01-23 22:26 ` Robert Millan
2008-01-24 0:21 ` Franklin PIAT
@ 2008-01-24 10:19 ` Marco Gerards
1 sibling, 0 replies; 5+ messages in thread
From: Marco Gerards @ 2008-01-24 10:19 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan <rmh@aybabtu.com> writes:
> 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.
>
> 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.
It would be useful, for testing, if grub-mkrescue can make a floppy/hd
image with a filesystem on it. IIRC it can't make hd images yet,
right?
--
Marco
^ permalink raw reply [flat|nested] 5+ messages in thread