#!/bin/bash
# The example names get mapped to their roles here
orig_iso="$HOME"/iso/foxclone.iso
new_iso="$HOME"/iso/foxclone025-02.iso
mbr_template="$HOME"/isohdpfx.bin
workdir="$HOME"/work
echo $HOME
echo $workdir is workdir
# Extract MBR template file to disk
dd if="$orig_iso" bs=1 count=432 of="$mbr_template"
# Create the new ISO image
xorriso -as mkisofs \
-U \
-allow-lowercase \
-r -V 'foxclone025-02' \
-o "$new_iso" \
-J -J -joliet-long \
-isohybrid-mbr "$mbr_template" \
-b "$workdir"/isolinux/isolinux.bin \ <-------- fails here. The file does exist at that location.
-c isolinux/boot.cat \
-boot-load-size 4 -boot-info-table -no-emul-boot \
-eltorito-alt-boot \
-e boot/grub/efi.img \
-no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus
Error in terminal I've been trying to fix this for 2 days, doing a crazy amount of research. Does anybody see anything that my old eyes have missed?
EDIT: Got it fixed by changing the line:
xorriso -as mkisofs \
to
xorriso -as mkisofs "$workdir" \
and removing the reference to $workdir
in the -b
line
the complaint of xorriso says that the -b file is not found in the ISO. In the command i see two reasons for this:
1: You use the absolute disk path instead of the path in the ISO.
2: There is no xorriso argument to see by which the file would get into the ISO. Actually no files at all seem to get mapped into the ISO.
Proposal:
If you want all files of "$workdir" in the ISO, add argument "$workdir".
If you expect isolinux.bin to show up in /isolinux/ of the ISO, remove from the path of option -b the prefix "$workdir"/ so that the path complies to the prescription of both, mkisofs and xorrisofs (*).
(*) mkisofs demands disk paths "relative to the source path", xorrisofs demands paths in the emerging ISO. Default working directory in the ISO is /. So the path "isolinux/isolinux.bin" is usable and advised for both.
See how Debian packs up its x86 bootable ISOs in principle: https://wiki.debian.org/RepackBootableISO#Remove_the_unneeded_Jigdo_production_options
(Support mailing list for xorriso is [email protected].)
Have a nice day :)
Thomas