* [PATCH] use cdboot.img in grub-mkrescue
@ 2008-02-03 13:33 Robert Millan
2008-02-03 18:30 ` Robert Millan
0 siblings, 1 reply; 2+ messages in thread
From: Robert Millan @ 2008-02-03 13:33 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
Thanks to Bean's latest effort (and to Alex Roman, I assume), grub-mkrescue can
be made a bit cleaner by using cdboot.img instead of the floppy emulation hack.
See attached patch.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
[-- Attachment #2: cdboot.diff --]
[-- Type: text/x-diff, Size: 2770 bytes --]
* util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to
use `cdboot.img' for cdrom images.
diff -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/i386/pc/grub-mkrescue.in ./util/i386/pc/grub-mkrescue.in
--- ../grub2/util/i386/pc/grub-mkrescue.in 2008-01-23 12:25:52.000000000 +0100
+++ ./util/i386/pc/grub-mkrescue.in 2008-02-03 14:15:19.000000000 +0100
@@ -1,7 +1,7 @@
#! /bin/sh -e
# Make GRUB rescue image
-# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -102,41 +102,45 @@ if test "x$output_image" = x; then
exit 1
fi
-if [ "x${image_type}" = "xfloppy" ] ; then
- floppy_image=${output_image}
-else
- floppy_image=`mktemp`
-fi
+aux_dir=`mktemp -d`
+mkdir -p ${aux_dir}/boot/grub
-memdisk_dir=`mktemp -d`
-mkdir -p ${memdisk_dir}/boot/grub
cp ${input_dir}/*.mod \
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
- ${memdisk_dir}/boot/grub/
+ ${aux_dir}/boot/grub/
if test "x$overlay" = x ; then : ; else
- cp -dpR ${overlay}/* ${memdisk_dir}/
+ cp -dpR ${overlay}/* ${aux_dir}/
fi
-memdisk_img=`mktemp`
-tar -C ${memdisk_dir} -cf ${memdisk_img} boot
-rm -rf ${memdisk_dir}
-
-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
-rm -f ${core_img}
-
if [ "x${image_type}" = "xfloppy" ] ; then
- exit 0
+ # build memdisk
+ memdisk_img=`mktemp`
+ tar -C ${aux_dir} -cf ${memdisk_img} boot
+ rm -rf ${aux_dir}
+
+ # build core.img
+ core_img=`mktemp`
+ ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules}
+ rm -f ${memdisk_img}
+
+ # build floppy image
+ cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $output_image
+ rm -f ${core_img}
+else
+ # build core.img
+ core_img=`mktemp`
+ ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 ${modules}
+
+ # build grub_eltorito image
+ cat ${input_dir}/cdboot.img ${core_img} > ${aux_dir}/boot/grub/grub_eltorito
+ rm -f ${core_img}
+
+ # build iso image
+ genisoimage -b boot/grub/grub_eltorito \
+ -no-emul-boot -boot-load-size 4 -boot-info-table \
+ -o ${output_image} -r ${aux_dir}
+ rm -rf ${aux_dir}
fi
-iso_dir=`mktemp -d`
-cp $floppy_image ${iso_dir}/floppy.img
-genisoimage -b floppy.img -o ${output_image} -r ${iso_dir}
-rm -rf ${iso_dir}
-
-rm -f ${floppy_image}
-
exit 0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] use cdboot.img in grub-mkrescue
2008-02-03 13:33 [PATCH] use cdboot.img in grub-mkrescue Robert Millan
@ 2008-02-03 18:30 ` Robert Millan
0 siblings, 0 replies; 2+ messages in thread
From: Robert Millan @ 2008-02-03 18:30 UTC (permalink / raw)
To: grub-devel
On Sun, Feb 03, 2008 at 02:33:40PM +0100, Robert Millan wrote:
>
> Thanks to Bean's latest effort (and to Alex Roman, I assume), grub-mkrescue can
> be made a bit cleaner by using cdboot.img instead of the floppy emulation hack.
>
> See attached patch.
Committed.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-03 18:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-03 13:33 [PATCH] use cdboot.img in grub-mkrescue Robert Millan
2008-02-03 18:30 ` Robert Millan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.