summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_cdebootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:11 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:30 +0100
commit85c342c299231131d22764c0dfdcf977c57ce147 (patch)
tree1226c8a7ad43a2dd53e411c2e379969424e88e32 /helpers/lh_bootstrap_cdebootstrap
parentd1ee66e44c8272bb7a0053a456a3d8b0bd152268 (diff)
downloadvyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.tar.gz
vyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.zip
Adding live-helper 1.0~a13-1.
Diffstat (limited to 'helpers/lh_bootstrap_cdebootstrap')
-rwxr-xr-xhelpers/lh_bootstrap_cdebootstrap42
1 files changed, 19 insertions, 23 deletions
diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap
index dad894865..2eaa23fe9 100755
--- a/helpers/lh_bootstrap_cdebootstrap
+++ b/helpers/lh_bootstrap_cdebootstrap
@@ -9,24 +9,21 @@
set -e
-# Source common functions
-for FUNCTION in /usr/share/live-helper/functions/*.sh
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
do
- . ${FUNCTION}
+ . "${FUNCTION}"
done
-# Set static variables
+# Setting static variables
DESCRIPTION="bootstrap a Debian system with cdebootstrap(1)"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
-# Ensure that a system is built as root
-lh_testroot
-
-Echo_debug "Init ${PROGRAM}"
-
# Reading configuration files
Read_conffile config/common
Read_conffile config/bootstrap
@@ -35,13 +32,16 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Breakpoint "bootstrap_cdeboostrap: Init"
-
if [ "${LH_BOOTSTRAP}" != "cdebootstrap" ]
then
exit 0
fi
+Echo_message "Begin bootstrapping system..."
+
+# Ensure that a system is built as root
+lh_testroot
+
# Checking stage file
Check_stagefile .stage/bootstrap
@@ -52,10 +52,7 @@ Check_lockfile .lock
Create_lockfile .lock
# Creating chroot directory
-if [ ! -d chroot ]
-then
- mkdir -p chroot
-fi
+mkdir -p chroot
# Setting cdebootstrap options
if [ -n "${LIVE_ARCHITECTURE}" ]
@@ -68,6 +65,11 @@ then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --suite-config=${LIVE_BOOTSTRAP_CONFIG}"
fi
+if [ -n "${LIVE_BOOTSTRAP_KEYRING}" ]
+then
+ CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --keyring=${LIVE_BOOTSTRAP_KEYRING}"
+fi
+
if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ]
then
CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=standard"
@@ -134,10 +136,7 @@ then
fi
# Saving new cache
- if [ ! -d cache/packages_bootstrap ]
- then
- mkdir -p cache/packages_bootstrap
- fi
+ mkdir -p cache/packages_bootstrap
cp chroot/var/cache/bootstrap/*.deb cache/packages_bootstrap
fi
@@ -174,10 +173,7 @@ then
rm -rf cache/stages_bootstrap
fi
- if [ ! -d cache ]
- then
- mkdir cache
- fi
+ mkdir -p cache
${LH_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap