Bash xorriso script to build .iso failing (SOLVED)

Forum rules
Before you post please read how to get help
Post Reply
User avatar
Larry78723
Level 7
Level 7
Posts: 1808
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Bash xorriso script to build .iso failing (SOLVED)

Post by Larry78723 »

I'm using xorisso to build an iso using the following script:

Code: Select all

#!/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 
Here's the terminal output:
terminal2.png
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?

TIA,
Larry
Last edited by Larry78723 on Wed Jan 01, 2020 3:17 pm, edited 2 times in total.
Image

Kadaitcha Man
Level 4
Level 4
Posts: 476
Joined: Mon Aug 27, 2012 10:17 pm

Re: Bash script to build .iso failing

Post by Kadaitcha Man »

Larry78723 wrote:
Tue Dec 31, 2019 8:44 pm

Code: Select all

   -b "$workdir"/isolinux/isolinux.bin \   <--------  fails here. The file does exist at that location.
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?
Maybe you missed identifying the location of the file and editing the script accordingly.
It's kad-eye-cha, not kada-itcha.

User avatar
Larry78723
Level 7
Level 7
Posts: 1808
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: Bash script to build .iso failing

Post by Larry78723 »

Kadaitcha Man, thanks for the reply. I've double checked the location several times. I even copied the file to a different location and used the actual location in the script instead of using the variable.
Image

rene
Level 14
Level 14
Posts: 5139
Joined: Sun Mar 27, 2016 6:58 pm

Re: Bash xorriso script to build .iso failing

Post by rene »

You will first need to have the -b filename be relative to the ISO root, i.e., just "isolinux/isolinux.bin". Second, you are not providing any pathspec to mkisofs / xorriso -as mkisofs. I.e., stick a "$workdir" in there as the final argument. I do seem to remember something about current directory being good enough at one point but note we're dealing with emulation syntax here; don't rely on it being that 100%; just provide the pathspec explicitly.

User avatar
Larry78723
Level 7
Level 7
Posts: 1808
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: Bash xorriso script to build .iso failing

Post by Larry78723 »

Got it fixed by changing the line:

Code: Select all

 xorriso -as mkisofs \ 
to

Code: Select all

xorriso -as mkisofs "$workdir" \
and removing the reference to $workdir in the line starting with -b
Image

Post Reply

Return to “Scripts & Bash”