2008-02-03 Robert Millan <rmh@aybabtu.com>

* util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to
        use `cdboot.img' for cdrom images.
This commit is contained in:
robertmh 2008-02-03 18:30:20 +00:00
parent 3b3f662905
commit e0ca067708
2 changed files with 37 additions and 28 deletions

View file

@ -1,3 +1,8 @@
2008-02-03 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to
use `cdboot.img' for cdrom images.
2008-02-03 Robert Millan <rmh@aybabtu.com> 2008-02-03 Robert Millan <rmh@aybabtu.com>
* util/grub.d/00_header.in: Issue scripting commands for GRUB to * util/grub.d/00_header.in: Issue scripting commands for GRUB to

View file

@ -1,7 +1,7 @@
#! /bin/sh -e #! /bin/sh -e
# Make GRUB rescue image # 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 # GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # 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 exit 1
fi fi
if [ "x${image_type}" = "xfloppy" ] ; then aux_dir=`mktemp -d`
floppy_image=${output_image} mkdir -p ${aux_dir}/boot/grub
else
floppy_image=`mktemp`
fi
memdisk_dir=`mktemp -d`
mkdir -p ${memdisk_dir}/boot/grub
cp ${input_dir}/*.mod \ cp ${input_dir}/*.mod \
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ ${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 if test "x$overlay" = x ; then : ; else
cp -dpR ${overlay}/* ${memdisk_dir}/ cp -dpR ${overlay}/* ${aux_dir}/
fi 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 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 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 exit 0