Skip to content

Instantly share code, notes, and snippets.

@dexterous
Created May 17, 2014 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dexterous/8633e6fcd46f0cbc272d to your computer and use it in GitHub Desktop.
Save dexterous/8633e6fcd46f0cbc272d to your computer and use it in GitHub Desktop.
Quick script to build build VBox VM from latest SmartOS build
#!/bin/sh
#set -o xtrace
#set -o verbose
#set -o errexit
#set -o errtrace
latest_url="https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/latest"
latest=$(curl -s "$latest_url")
echo "Latest build is $latest"
base_url="https://us-east.manta.joyent.com$latest"
file_name="smartos-${latest##*/}-USB.img.bz2"
download_url="$base_url/$file_name"
echo "Downloading from $download_url"
curl -#OC - "$download_url"
checksum_url="$base_url/md5sums.txt"
curl -s "$checksum_url" | grep img.bz2 | md5sum -c --status -
if [ $? -ne 0 ]; then
echo "MD5 checksum mismatched!"
echo "Delete downloaded image and try again."
#echo "Deleting downloaded image, try again."
#rm "$file_name"
exit 1
fi
#bunzip2 "$file_name"
#VBoxManage convertfromraw "${file_name%%.bz2}" "${file_name%%-USB.img.bz2}".vmdk --format VMDK
#create VM; refer http://wiki.smartos.org/display/DOC/SmartOS+as+a+Sandboxed+VirtualBox+Guest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment