Bash xorriso script to build .iso failing (SOLVED)

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
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 LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Image
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Bash script to build .iso failing

Post by Moonstone 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.
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
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
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
rene
Level 20
Level 20
Posts: 12212
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 14
Level 14
Posts: 5476
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
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
Locked

Return to “Scripts & Bash”