Commit 49200bce authored by Tails developers's avatar Tails developers
Browse files

vagrant: Always use a temporary build directory

Previously, we only used a temporary directory for in-memory builds. Disk based
builds relied on `lb clean` instead. To make the switch from disk based builds
to in-memory builds more reliable, we use a temporary build directory
than is removed once the build is done in both cases.
parent a95b25bd
......@@ -36,18 +36,18 @@ cd /home/vagrant/amnesia
git fetch origin
as_root_do git checkout --force "$REV"
as_root_do git reset --hard "$COMMIT"
as_root_do lb clean || true
BUILD_DIR=$(mktemp -d /home/vagrant/tails-build.XXXXXXXX)
if [ "$TAILS_RAM_BUILD" ]; then
BUILD_DIR=$(mktemp -d /home/vagrant/tails-build.XXXXXXXX)
trap "cd / ; sudo umount '$BUILD_DIR' ; sudo rmdir '$BUILD_DIR'" EXIT
as_root_do mount -t tmpfs -o "noatime,size=${TMPFS_SIZE}G,mode=0770,uid=root,gid=vagrant" tmpfs "$BUILD_DIR"
as_root_do rsync -a /home/vagrant/amnesia/ "$BUILD_DIR"/
trap "cd / ; sudo rm -rf '$BUILD_DIR'" EXIT
as_root_do rsync -a /home/vagrant/amnesia/ "$BUILD_DIR"/
as_root_do lb config
as_root_do lb build
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment