--- /dev/null
+#!/bin/bash
+#
+# Run xorriso to make a bootable ISO of bootimage.raw; a hybrid, nulti
+# mode bootable ISO.
+
+set -e
+
+ISOTREE=isotree
+ISO=tiniest.iso
+P1=$ISOTREE/part1.raw
+
+echo "# Prepare ISO content tree"
+
+if [ ! -d $ISOTREE ] ; then
+ mkdir $ISOTREE
+ touch $ISOTREE/catalog # Boot catalog
+ # Determine start and size of first parition
+ X=( $(sfdisk -l -ostart,sectors bootimage.raw | tail -n 2) )
+ dd if=bootimage.raw of=$P1 skip=${X[0]} count=${X[1]}
+ echo "# Add isolinux boot loader"
+ mcopy -i $P1 kernel/usr/lib/ISOLINUX/isolinux.bin ::/
+ mcopy -i $P1 kernel/usr/lib/ISOLINUX/isohdppx.bin ::/
+fi
+
+[ ! -r $ISO ] || rm $ISO
+PREPID="'$(id -un), $(getent passwd $(id -un)|awk -F: '{print $5}')'"
+
+XORRISO=(
+ -report_about ALL
+ --outdev $ISO
+ -map $ISOTREE /
+ -rockridge on -joliet on
+ -volid "TINIEST"
+ -volset_id "$(date +"Tiniest %Y-%m-%d %H:%M:%S")"
+ -publisher "Ralph (rrq) Ronnquist"
+ -application_id "Hybrid Multi Mode Disk Image"
+ -system_id "Tiniest Linux HMMDI"
+ #-copyright_file copyright.txt
+ #-abstract_file abstract.txt
+ #-biblio_file biblio.txt
+ -preparer_id "$PREPID"
+ #-application_use path
+ #-out_charset "UTF8" ??
+ -uid 0 -gid 0
+)
+
+BOOT1=(
+ -boot_image any cat_path=/catalog
+ -append_partition 2 0xef ${P1}
+ -boot_image any
+ efi_path=--interval:appended_partition_2:all::/EFI/BOOT/bootx64.efi
+ #-boot_image isolinux system_area=kernel/usr/lib/ISOLINUX/isohdppx.bin
+ -boot_image and part_like_isohybrid=on
+ # -boot_image any
+# bin_path=--interval:appended_partition_2:all::/isolinux.bin
+)
+
+XORRISO=( "${XORRISO[@]}" "${BOOT1[@]}" )
+#for A in "${XORRISO[@]}" ; do echo "$A" ; done
+xorriso "${XORRISO[@]}"