if [ -x "$(which xorriso 2> /dev/null)" ]; then
M="xorriso -as mkisofs -isohybrid-mbr $DIR/boot/syslinux/isohdpfx.bin"
D=" -isohybrid-gpt-basdat -e"
elif [ -x "$(which genisoimage 2> /dev/null)" ]; then
M=genisoimage ; D="-efi-boot"
else
M=mkisofs ; D="-eltorito-platform 0xEF -eltorito-boot"
fi
E="EFI/boot/efiboot.img -no-emul-boot"
VER="Parted Magic $VER"
if ! $M -hide-rr-moved -f -r -J -l -V "$VER" -A "$VER" \
$B $C $D $E -o $ISO $DIR ; then
exit 1
fi
echo ">>> $ISO created"
# xorriso has hybridization built-in
if [ "$(echo $M | cut -d" " -f1)" != "xorriso" ]; then
if [ -x "$(which isohybrid 2> /dev/null)" ]; then
isohybrid -uefi $ISO
else
echo ">>> No isohybrid to hybridize this ISO"
fi
fi