summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_debootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:52 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:29 +0100
commitbd1a5ddc8203907eb40135303bea5488397ec5d0 (patch)
treee1cdc0adec3e4799f5db5ad1a8b34800e28a9439 /helpers/lh_bootstrap_debootstrap
parent8a4a50fdb6b206fbff62fd3043ed388f25a0ffb1 (diff)
downloadvyos-live-build-bd1a5ddc8203907eb40135303bea5488397ec5d0.tar.gz
vyos-live-build-bd1a5ddc8203907eb40135303bea5488397ec5d0.zip
Adding live-helper 1.0~a8-1.
Diffstat (limited to 'helpers/lh_bootstrap_debootstrap')
-rwxr-xr-xhelpers/lh_bootstrap_debootstrap57
1 files changed, 32 insertions, 25 deletions
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap
index 43fdd9665..0538422b1 100755
--- a/helpers/lh_bootstrap_debootstrap
+++ b/helpers/lh_bootstrap_debootstrap
@@ -28,10 +28,11 @@ lh_testroot
Echo_debug "Init ${PROGRAM}"
# Reading configuration files
+Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/chroot
-Read_conffile config/common
-Read_conffile config/image
+Read_conffile config/binary
+Read_conffile config/source
Set_defaults
Breakpoint "bootstrap_debootstrap: Init"
@@ -74,12 +75,12 @@ fi
if [ -x "/usr/sbin/debootstrap" ]
then
- if [ "${LH_CACHE}" = "enabled" ]
- then
- # Restore old cache
- if [ -d cache/chroot_bootstrap ]
+ for STAGE in ${LH_CACHE_STAGES}
+ do
+ if [ "${STAGE}" = "bootstrap" ] && [ -d cache/stages_bootstrap ]
then
- ${LH_ROOT_COMMAND} cp -a cache/chroot_bootstrap/* chroot
+ # Restore old cache
+ ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap/* chroot
if [ -n "${LH_ROOT_COMMAND}" ]
then
@@ -91,11 +92,14 @@ then
exit 0
fi
+ done
- if [ -d cache/bootstrap ]
+ if [ "${LH_CACHE_PACKAGES}" = "enabled" ]
+ then
+ if [ -d cache/packages_bootstrap ]
then
mkdir -p chroot/var/cache/apt/archives
- cp cache/bootstrap/*.deb chroot/var/cache/apt/archives
+ cp cache/packages_bootstrap/*.deb chroot/var/cache/apt/archives
fi
# Executing debootstrap (download-only)
@@ -107,18 +111,18 @@ then
fi
# Removing old cache
- if [ -d cache/bootstrap ]
+ if [ -d cache/packages_bootstrap ]
then
- rm -f cache/bootstrap/*.deb
+ rm -f cache/packages_bootstrap/*.deb
fi
# Saving new cache
- if [ ! -d cache/bootstrap ]
+ if [ ! -d cache/packages_bootstrap ]
then
- mkdir -p cache/bootstrap
+ mkdir -p cache/packages_bootstrap
fi
- cp chroot/var/cache/apt/archives/*.deb cache/bootstrap
+ cp chroot/var/cache/apt/archives/*.deb cache/packages_bootstrap
fi
# Executing debootstrap (regular run)
@@ -130,23 +134,26 @@ then
fi
# Removing bootstrap cache
- rm -rf chroot/var/cache/apt/archives/*.deb
+ rm -f chroot/var/cache/apt/archives/*.deb
# Saving new cache
- if [ "${LH_CACHE}" = "enabled" ]
- then
- if [ -d cache/chroot_bootstrap ]
+ for STAGE in ${LH_CACHE_STAGES}
+ do
+ if [ "${STAGE}" = "bootstrap" ]
then
- rm -rf cache/chroot_bootstrap
- fi
+ if [ -d cache/stages_bootstrap ]
+ then
+ rm -rf cache/stages_bootstrap
+ fi
- ${LH_ROOT_COMMAND} cp -a chroot cache/chroot_bootstrap
+ ${LH_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap
- if [ -n "${LH_ROOT_COMMAND}" ]
- then
- ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/chroot_bootstrap
+ if [ -n "${LH_ROOT_COMMAND}" ]
+ then
+ ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/stages_bootstrap
+ fi
fi
- fi
+ done
# Creating stage file
Create_stagefile .stage/bootstrap