From 6a8d8d2e39f4bb1f2acd452d65cc6fb342c8ff14 Mon Sep 17 00:00:00 2001 From: Justin Head Date: Wed, 10 Aug 2016 09:42:06 -0700 Subject: [PATCH] contrib: add support for Mac OS X hdiutil Allow users to create a config-drive on Mac OS X. --- contrib/create-basic-configdrive | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/create-basic-configdrive b/contrib/create-basic-configdrive index ece7849c6c..ec07278c70 100755 --- a/contrib/create-basic-configdrive +++ b/contrib/create-basic-configdrive @@ -71,10 +71,15 @@ fi # mkisofs/genisoimage tool check if which mkisofs &>/dev/null; then mkisofs=$(which mkisofs) + mkisofs_opts="-R -V config-2" elif which genisoimage &>/dev/null; then mkisofs=$(which genisoimage) + mkisofs_opts="-R -V config-2" +elif which hdiutil &>/dev/null; then + mkisofs=$(which hdiutil) + mkisofs_opts="makehybrid -iso -joliet -default-volume-name config-2" else - echo "$0: mkisofs or genisoimage tool is required to create image." >&2 + echo "$0: mkisofs, genisoimage, or hdiutil tool is required to create image." >&2 exit 1 fi @@ -175,7 +180,7 @@ CLOUD_CONFIG="${CLOUD_CONFIG//${HNAME}}" echo "$CLOUD_CONFIG" > "$CONFIG_FILE" -$mkisofs -R -V config-2 -o "$CONFIGDRIVE_FILE" "$WORKDIR" +$mkisofs $mkisofs_opts -o "$CONFIGDRIVE_FILE" "$WORKDIR" if [ "$?" -eq 0 ] ; then echo