+ # pad the output ISO to multiples of 256 KiB for partition table support
+ siz=$($getfilesize "${ISO_OUTPUT}/${ISO_NAME}")
+ cyls=$((siz / 512 / 32 / 16 + 1)) # C=$cyls H=16 S=32
+ siz=$((cyls * 16 * 32 * 512)) # size after padding
+ dd if=/dev/zero bs=1 count=1 seek=$((siz - 1)) \
+ of="${ISO_OUTPUT}/${ISO_NAME}" 2>/dev/null
+
+ # support disabling hybrid ISO image
+ if [ "$HYBRID_METHOD" = "disable" ] ; then\
+ log "Skipping creation of hybrid ISO file as requested via HYBRID_METHOD=disable"
+ einfo "Skipping creation of hybrid ISO file as requested via HYBRID_METHOD=disable"
+ eend 0
+ # use isohybrid only on request
+ elif [ "$HYBRID_METHOD" = "isohybrid" ] ; then
+ if ! which isohybrid >/dev/null 2>&1 ; then
+ bailout 12 "isohybrid binary not found - please install syslinux/syslinux-common"
+ else
+ log "Creating hybrid ISO file with isohybrid method"
+ einfo "Creating hybrid ISO file with isohybrid method"
+ isohybrid "${ISO_OUTPUT}/${ISO_NAME}"
+ eend $?
+ fi
+ # by default use our manifold boot method:
+ else
+ if ! [ -r boot/grub/core.img ] ; then
+ ewarn "boot/grub/core.img not found, not creating manifold boot ISO file"
+ else
+ log "Creating hybrid ISO file with manifold method"
+ einfo "Creating hybrid ISO file with manifold method"
+ echo 1 63 | \
+ mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 1 -p 0x83 -g $cyls:16:32 | \
+ cat - boot/grub/core.img | \
+ dd conv=notrunc of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null
+ eend $?
+ fi
+ fi
+