Created
May 17, 2014 19:01
-
-
Save dexterous/8633e6fcd46f0cbc272d to your computer and use it in GitHub Desktop.
Quick script to build build VBox VM from latest SmartOS build
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/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