Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 37 lines (31 sloc) 923 Bytes
#!/bin/bash
# Script to build, provision, export and pack a vagrant box. To use the
# pre-configured box, import it directly in VirtualBox.
set -e -x
create_vagrant_box() {
echo "Warning: ensure that your current box is clean!"
echo " It shall not contain any non-automated customazation."
echo vagrant up --provision
vagrant package
mv package.box snp.box
}
disconnect_uart() {
# Vagrant connects first UART to a logfile. Path to logfile may differ on
# different installations.
sed -i -r \
-e '\|<UART>|,\|</UART>| {
s|path=".*" hostMode=".*"|path="" hostMode="Disconnected"|
}' \
"${1}"
}
repack_box_as_zip() {
mkdir snp-box
tar xfvvz snp.box -C snp-box
disconnect_uart snp-box/box.ovf
zip -v -9 -r snp-box.zip snp-box
rm -rf snp-box
}
cd "$(dirname "${0}")"
cd desktop-vm
create_vagrant_box
repack_box_as_zip
You can’t perform that action at this time.