From 9e50b92ecd97e928035e6791df3ea03230f757a6 Mon Sep 17 00:00:00 2001 From: sidneys Date: Tue, 7 Apr 2020 22:43:50 +0200 Subject: [PATCH] feat(macos-compatibility): add usage of mkisofs instead of genisoimage when appropriate (on macOS) --- convert.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 convert.sh diff --git a/convert.sh b/convert.sh old mode 100644 new mode 100755 index 8b40000..fbd0cb0 --- a/convert.sh +++ b/convert.sh @@ -296,8 +296,8 @@ if ! which cabextract >/dev/null 2>&1 \ if [[ "$(uname)" == "Linux" ]]; then # Linux - echo "If you use Debian or Ubuntu you can install these using:" - echo "sudo apt-get install cabextract wimtools chntpw genisoimage" + echo "If you use Debian or Ubuntu you can install these using:" + echo "sudo apt-get install cabextract wimtools chntpw genisoimage" elif [[ "$(uname)" == "Darwin" ]]; then # macOS echo "If you use Homebrew, you can install these using:" @@ -566,7 +566,13 @@ fi echo -e "$infoColor""Creating ISO image...""$resetColor" find ISODIR -exec touch {} + -genisoimage -b "boot/etfsboot.com" --no-emul-boot \ +# Use mkisofs instead of genisoimage if it was not found +$genisoimage=`which genisoimage >/dev/null 2>&` +if [ -z $genisoimage ]; then + $genisoimage=`which mkisofs >/dev/null 2>&` +fi + +"$genisoimage" -b "boot/etfsboot.com" --no-emul-boot \ --eltorito-alt-boot -b "efi/microsoft/boot/efisys.bin" --no-emul-boot \ --udf --hide "*" -V "$isoLabel" -o "$isoName" ISODIR