summaryrefslogtreecommitdiff
path: root/run-bootstrap-in-chroot
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-02-27 12:09:59 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-02-27 12:09:59 +0000
commit114e276f7c1da9c06cce0dd5e1b89f289b61f507 (patch)
tree58ab58f8c1ed0f13eb37e306924e7a36a2a1ce8c /run-bootstrap-in-chroot
parent384744b859f9c55d3801397b131af7d055dff32f (diff)
downloadmorph-114e276f7c1da9c06cce0dd5e1b89f289b61f507.tar.gz
scripts: allow running without snapshots
Set the #! to bash, as it uses bashisms Everywhere where it would try to run tar has a check for $snapshot Allows the snapshot variable to be set in the environment for the script to use that, it seemed easier than adding an option Use run_pass for stage 3 since it can have snapshotting disabled
Diffstat (limited to 'run-bootstrap-in-chroot')
-rwxr-xr-xrun-bootstrap-in-chroot8
1 files changed, 4 insertions, 4 deletions
diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot
index 9f90d50b..05207207 100755
--- a/run-bootstrap-in-chroot
+++ b/run-bootstrap-in-chroot
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
set -e
@@ -40,7 +40,7 @@ run_pass()
local passname="$2"
local tarball=$(pass_snapshot "$passname")
- if has_pass "$passname"
+ if "$snapshot" && has_pass "$passname"
then
tar -C "$dir" -xf "$tarball"
update_morph "$dir"
@@ -64,7 +64,7 @@ fi
mkdir -p "$1"
dir="$1/squeeze-chroot"
-snapshot=true
+: ${snapshot:=true}
snapshotdir="$1"
cat >"./do-squeeze-chroot" <<EOF
@@ -154,7 +154,7 @@ then
fi
run_pass "$dir" pass2b
-"./do-squeeze-chroot" bash -x baserock-bootstrap pass3 || exit 1
+snapshot=false run_pass "$dir" pass3
echo "Passes 1, 2, and 3 of bootstrap done (possibly cached)."