summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_debootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:49 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:29 +0100
commitda353a5231ad925013d01065768864307c70651a (patch)
tree589606906e4e8966797f352ec63162cbb4016da0 /helpers/lh_bootstrap_debootstrap
parent068a51b175546dfeac45c747236817cb41db50d7 (diff)
downloadvyos-live-build-da353a5231ad925013d01065768864307c70651a.tar.gz
vyos-live-build-da353a5231ad925013d01065768864307c70651a.zip
Adding live-helper 1.0~a4-1.
Diffstat (limited to 'helpers/lh_bootstrap_debootstrap')
-rwxr-xr-xhelpers/lh_bootstrap_debootstrap34
1 files changed, 34 insertions, 0 deletions
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap
index ab7ac6b99..87dd30ef6 100755
--- a/helpers/lh_bootstrap_debootstrap
+++ b/helpers/lh_bootstrap_debootstrap
@@ -25,11 +25,19 @@ Arguments "${@}"
# Ensure that a system is built as root
lh_testroot
+# Starting helper
+Echo_debug "Init ${PROGRAM}"
+
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
Set_defaults
+if [ "${LH_BOOTSTRAP}" != "debootstrap" ]
+then
+ exit 0
+fi
+
# Checking stage file
Check_stagefile .stage/bootstrap
@@ -56,11 +64,26 @@ then
LIVE_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LIVE_BOOTSTRAP_CONFIG}"
fi
+if [ "${VERBOSE}" = "true" ]
+then
+ DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --verbose"
+fi
+
if [ -x "/usr/sbin/debootstrap" ]
then
if [ "${LH_CACHE}" = "enabled" ]
then
# Restore old cache
+ if [ -d cache/chroot_bootstrap ]
+ then
+ cp -a cache/chroot_bootstrap/* chroot
+
+ # Creating stage file
+ Create_stagefile .stage/bootstrap
+
+ exit 0
+ fi
+
if [ -d cache/bootstrap ]
then
mkdir -p chroot/var/cache/apt/archives
@@ -91,6 +114,17 @@ then
# Removing bootstrap cache
rm -rf chroot/var/cache/apt/archives/*.deb
+ # Saving new cache
+ if [ "${LH_CACHE}" = "enabled" ]
+ then
+ if [ -d cache/chroot_bootstrap ]
+ then
+ rm -rf cache/chroot_bootstrap
+ fi
+
+ cp -a chroot cache/chroot_bootstrap
+ fi
+
# Creating stage file
Create_stagefile .stage/bootstrap
else