raspiblitz/alternative.platforms/amd64/packer/scripts/init_vagrant.sh
Alessio Caiazza 1edb9aa4d3
Add vagrant support (#1523)
This will allow building a raspiblitz base image with packer and spin up a development environment in a VM.
2020-09-23 13:28:18 +02:00

34 lines
607 B
Bash

#!/bin/bash
set -e
echo "************* Vagrant provisioning ********************"
if ! [ -e /dev/sdb1 ]; then
echo 'Data drive partitioning'
echo 'type=83' | sudo sfdisk /dev/sdb
fi
echo 'linking development files'
source_dir=/vagrant/home.admin
dest_dir=$HOME
cd $source_dir
for f in *; do
if [ "$f" = "assets" ] ; then
continue
fi
source_file="$source_dir/$f"
dest_file="$dest_dir/$f"
if [ -L $dest_file ] && [ "$(readlink "$dest_file")" = "$source_file" ]; then
continue
fi
rm -rf "$dest_file"
ln -s "$source_file" "$dest_file"
done