diff --git a/ubuntu-autoinstall-generator.sh b/ubuntu-autoinstall-generator.sh index 5229d83..2a3defb 100644 --- a/ubuntu-autoinstall-generator.sh +++ b/ubuntu-autoinstall-generator.sh @@ -154,7 +154,18 @@ log "🔎 Checking for required utilities..." [[ ! -x "$(command -v sed)" ]] && die "💥 sed is not installed. On Ubuntu, install the 'sed' package." [[ ! -x "$(command -v curl)" ]] && die "💥 curl is not installed. On Ubuntu, install the 'curl' package." [[ ! -x "$(command -v gpg)" ]] && die "💥 gpg is not installed. On Ubuntu, install the 'gpg' package." -[[ ! -f "/usr/lib/ISOLINUX/isohdpfx.bin" ]] && die "💥 isolinux is not installed. On Ubuntu, install the 'isolinux' package." +DIST=`lsb_release -i | cut -d ':' -f2` +if [[ "$DIST" == *"Arch"* ]]; then + [[ ! -f "/usr/lib/syslinux/bios/isohdpfx.bin" ]] && die "💥 isolinux is not installed. On Arch install Syslinux package" + ISOLINUX="/usr/lib/syslinux/bios/isohdpfx.bin" +else + [[ ! -f "/usr/lib/ISOLINUX/isohdpfx.bin" ]] && die "💥 isolinux is not installed. On Ubuntu, install the 'isolinux' package." + ISOLINUX="/usr/lib/ISOLINUX/isohdpfx.bin" +fi + +# [[ ! -f "/usr/lib/ISOLINUX/isohdpfx.bin" ]] && die "💥 isolinux is not installed. On Ubuntu, install the 'isolinux' package." +ISOLINUX="/usr/lib/syslinux/bios/isohdpfx.bin" +[[ ! -f "$ISOLINUX" ]] && die "💥 isolinux is not installed. On Ubuntu, install the 'isolinux' package." log "👍 All required utilities are installed." if [ ! -f "${source_iso}" ]; then @@ -263,7 +274,7 @@ fi log "📦 Repackaging extracted files into an ISO image..." cd "$tmpdir" -xorriso -as mkisofs -r -V "ubuntu-autoinstall-$today" -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -boot-info-table -input-charset utf-8 -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o "${destination_iso}" . &>/dev/null +xorriso -as mkisofs -r -V "ubuntu-autoinstall-$today" -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -isohybrid-mbr $ISOLINUX -boot-info-table -input-charset utf-8 -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o "${destination_iso}" . &>/dev/null cd "$OLDPWD" log "👍 Repackaged into ${destination_iso}"