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:
parent
3b3f662905
commit
e0ca067708
2 changed files with 37 additions and 28 deletions
|
@ -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>
|
||||
|
||||
* util/grub.d/00_header.in: Issue scripting commands for GRUB to
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue