2009-12-21 Robert Millan <rmh.grub@aybabtu.com>

* util/mkisofs/mkisofs.c (use_embedded_boot, boot_image_embed): New
        variables.
        (ld_options, main): Recognize `--embedded-boot'.
        * util/mkisofs/mkisofs.h (use_embedded_boot, boot_image_embed): New
        declarations.
        * util/mkisofs/write.c (PADBLOCK_SIZE): New variable.
        (padblock_size): Use `PADBLOCK_SIZE' instead of hardcoding 16.
        (padblock_write): Likewise.  Rewrite to support embedded boot image.

        * util/grub-mkrescue.in: When building i386-pc images, embed core.img
        for BIOS-based disk boot instead of only ElTorito.
This commit is contained in:
Robert Millan 2009-12-21 17:40:26 +00:00
parent b15937b110
commit 0ae5692966
5 changed files with 74 additions and 35 deletions

View file

@ -162,6 +162,10 @@ if test -e "${pc_dir}" ; then
grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \
iso9660 biosdisk
cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img
embed_img=`mktemp`
cat ${pc_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=32 > ${embed_img}
rm -f ${core_img}
modules="$(cat ${pc_dir}/partmap.lst) ${modules}"
@ -171,11 +175,14 @@ if test -e "${pc_dir}" ; then
echo "source /boot/grub/grub.cfg") \
> ${iso9660_dir}/boot/grub/i386-pc/grub.cfg
grub_mkisofs_arguments="${grub_mkisofs_arguments} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
grub_mkisofs_arguments="${grub_mkisofs_arguments} -b boot/grub/i386-pc/eltorito.img -boot-info-table \
--embedded-boot ${embed_img}"
fi
# build iso image
grub-mkisofs ${grub_mkisofs_arguments} -o ${output_image} -r ${iso9660_dir} ${source}
rm -rf ${iso9660_dir}
rm -f ${embed_img}
exit 0