Created
February 6, 2024 05:00
-
-
Save coughingmouse/ab76deae36cf411e96f8010250c55d58 to your computer and use it in GitHub Desktop.
Generation of Canonical cloud-utils cloud-localds on macOS with homebrew (OS X)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
brew install cdrtools curl | |
curl -fsSL https://raw.githubusercontent.com/canonical/cloud-utils/main/bin/cloud-localds -o cloud-localds | |
sed -i '' -e 's/genisoimage/mkisofs/g' cloud-localds | |
sed -i '' -e 's/.*confused by additional args/\[ \$\# \-le 9 \] \|\| bad_Usage \"confused by additional args/g' cloud-localds | |
sed -i '' -e 's/output\=\$1/output\=\$7/' cloud-localds | |
sed -i '' -e 's/userdata\=$2/userdata\=\$8/' cloud-localds | |
sed -i '' -e 's/metadata\=$3/metadata\=\$9/' cloud-localds | |
chmod +x cloud-localds |
The reason that $#
ends up weird is that cloud-localds expects gnu getopt. If you brew install gnu-getopt
and then replace the call to getopt
(line 70ish) with /opt/homebrew/opt/gnu-getopt/bin/getopt
, you can get rid of lines 5-8 of the above script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ipveesix's comment here helped.