xorrisofs: ExBootable

 
 6.7 Create bootable images for PC-BIOS and EFI
 ==============================================
 
 The SYSLINUX/ISOLINUX boot loader suite is popular for booting PC-BIOS.
 The ISOLINUX wiki prescribes to create on disk a directory ./CD_root and
 to copy all desired files underneath that directory.  Especially file
 isolinux.bin shall be copied to ./CD_root/isolinux/isolinux.bin .  This
 is the boot image file.
 The prescribed mkisofs options can be used unchanged with 'xorrisofs':
 
    $ xorrisofs -o output.iso \
 -b isolinux/isolinux.bin -c isolinux/boot.cat \
 -no-emul-boot -boot-load-size 4 -boot-info-table \
 ./CD_root
 
    Put it on CD by a burn program.  E.g.:
 
    $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed output.iso
 
    The image from above example will boot from CD, DVD or BD, but not
 from USB stick or other hard-disk-like devices.  This can be done by
 help of an isohybrid MBR. Syslinux provides matching template files as
 isohdp[fp]x*.bin .  E.g.  /usr/lib/syslinux/isohdpfx.bin .
 If a few hundred KB of size do not matter, then option -partition_offset
 can be used to create a partition table where partition 1 starts not at
 block 0.  This facilitates later manipulations of the USB stick by tools
 for partitioning and formatting.
 The image from the following example will be prepared for booting via
 MBR and its first partition will start at hard disk block 64.
 It will also boot from optical media.
 
    $ xorrisofs -o output.iso \
 -b isolinux/isolinux.bin -c isolinux/boot.cat \
 -no-emul-boot -boot-load-size 4 -boot-info-table \
 -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
 -partition_offset 16 \
 ./CD_root
 
    Become superuser and copy the image to the unpartitioned base device
 file of the USB stick.  On GNU/Linux this is e.g.  /dev/sdb, not
 /dev/sdb1.
 CAUTION: This will overwrite any partitioning on the USB stick and make
 remaining data unaccessible.
 So first make sure you got the correct address of the intended device.
 E.g.  by reading 100 MiB data from it and watching it blinking:
 
    # dd bs=2K if=/dev/sdb count=50K >/dev/null
 
    Now copy the image onto it
 
    # dd bs=2K if=output.iso of=/dev/sdb
 
    Now for EFI:
 The boot image file has to be the image of an EFI System Partition, i.e.
 a FAT filesystem with directory /EFI/BOOT and boot files with EFI
 prescribed names: BOOTIA32.EFI for 32 bit x86, BOOTx64.EFI for 64 bit
 AMD/x86 (in UEFI-2.4 there is indeed a lower case "x"), BOOTAA64.EFI for
 64 bit ARM. The software in the FAT filesystem should be able to find
 and inspect the ISO filesystem for boot loader configuration and start
 of operating system.  GRUB2 program grub-mkimage can produce such a FAT
 filesystem with suitable content, which then uses further GRUB2 software
 from the ISO filesystem.
 EFI boot equipment may be combined with above ISOLINUX isohybrid for
 PC-BIOS in a not really UEFI-2.4 compliant way, which obviously works
 well.  It yields MBR and GPT partition tables, both with nested
 partitions.  Assumed the EFI System Partition image is ready as
 ./CD_root/boot/grub/efi.img, add the following options before the
 directory address ./CD_root:
 
    -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \
 -isohybrid-gpt-basdat \
 
    More compliant with UEFI-2.4 is to decide for either MBR or GPT and
 to append a copy of the EFI System Partition in order to avoid overlap
 of ISO partition and EFI partition.  Here for MBR:
 
    -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \
 -append_partition 2 0xef ./CD_root/boot/grub/efi.img \
 
    The resulting ISOs are supposed to boot from optical media and USB
 stick.  One may omit option -eltorito-alt-boot if no option -b is used
 to make the ISO bootable via PC-BIOS.
 
    For ISOs with pure GRUB2 boot equipment consider to use GRUB2 tool
 grub-mkrescue as frontend to xorrisofs.
 
    If you have a bootable ISO filesystem and want to know its equipment
 plus a proposal how to reproduce it, try:
 
    $ xorriso -hfsplus on -indev IMAGE.iso \ -report_el_torito plain
 -report_system_area plain \ -print "" -print "======= Proposal for
 xorrisofs options:" \ -report_el_torito as_mkisofs