diff options
Diffstat (limited to 'helpers/lh_bootstrap_cdebootstrap')
-rwxr-xr-x | helpers/lh_bootstrap_cdebootstrap | 42 |
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 |