[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Create floppy emulation boot CD with grub-mkimage
From: |
Christian Franke |
Subject: |
Re: [PATCH] Create floppy emulation boot CD with grub-mkimage |
Date: |
Sat, 01 Mar 2008 22:05:22 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 |
Robert Millan wrote:
On Fri, Feb 15, 2008 at 11:32:49PM +0100, Christian Franke wrote:
...
The patch also adds a --joliet option, useful to access the long file
names on Windows (which has no RR support).
Is there any drawback in using --joliet ? If not, I think it's better to do
it by default to avoid "option creep".
Here a new version of the patch with Joliet enabled always. Should not
break anything.
Christian
2008-03-01 Christian Franke <address@hidden>
* util/i386/pc/grub-mkrescue.in: Add --emulation=floppy
to create a floppy emulation boot CD when non emulation mode
does not work.
Enable Joliet CD filesystem extension.
--- grub2.orig/util/i386/pc/grub-mkrescue.in 2008-02-09 14:02:56.057039500
+0100
+++ grub2/util/i386/pc/grub-mkrescue.in 2008-03-01 21:52:23.493466900 +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)
+ --emulation=TYPE select boot emulation type floppy or none (default)
grub-mkimage generates a bootable rescue image of the specified type.
@@ -56,6 +57,7 @@
image_type=cdrom
input_dir=${pkglibdir}
grub_mkimage=grub-mkimage
+emulation=none
# Check the arguments.
for option in "$@"; do
@@ -82,6 +84,14 @@
echo "Unknown image type \`$image_type'" 1>&2
exit 1 ;;
esac ;;
+ --emulation=*)
+ emulation=`echo "$option" | sed 's/--emulation=//'`
+ case "$emulation" in
+ floppy|none) ;;
+ *)
+ echo "Unknown emulation type \`$emulation'" 1>&2
+ exit 1 ;;
+ esac ;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
@@ -113,7 +123,7 @@
cp -dpR ${overlay}/* ${aux_dir}/
fi
-if [ "x${image_type}" = "xfloppy" ] ; then
+if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then
# build memdisk
memdisk_img=`mktemp`
tar -C ${aux_dir} -cf ${memdisk_img} boot
@@ -125,8 +135,21 @@
rm -f ${memdisk_img}
# build floppy image
- cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 >
$output_image
+ if [ "x${image_type}" = xcdrom ] ; then
+ floppy_dir=`mktemp -d`
+ floppy_img=${floppy_dir}/grub_floppy.img
+ else
+ floppy_img=${output_image}
+ fi
+ cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 >
${floppy_img}
rm -f ${core_img}
+
+ if [ "x${image_type}" = xcdrom ] ; then
+ # build iso image
+ genisoimage -b grub_floppy.img \
+ -o ${output_image} -r -J ${floppy_dir}
+ rm -rf ${floppy_dir}
+ fi
else
# build core.img
core_img=`mktemp`
@@ -139,7 +162,7 @@
# 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}
+ -o ${output_image} -r -J ${aux_dir}
rm -rf ${aux_dir}
fi
- Re: [PATCH] Create floppy emulation boot CD with grub-mkimage,
Christian Franke <=