diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:11 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:18:30 +0100 |
commit | 85c342c299231131d22764c0dfdcf977c57ce147 (patch) | |
tree | 1226c8a7ad43a2dd53e411c2e379969424e88e32 /helpers/lh_bootstrap_debootstrap | |
parent | d1ee66e44c8272bb7a0053a456a3d8b0bd152268 (diff) | |
download | vyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.tar.gz vyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.zip |
Adding live-helper 1.0~a13-1.
Diffstat (limited to 'helpers/lh_bootstrap_debootstrap')
-rwxr-xr-x | helpers/lh_bootstrap_debootstrap | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index c3e4cada4..58d36c4d7 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -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 debootstrap(8)" 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_debootstrap: Init" - if [ "${LH_BOOTSTRAP}" != "debootstrap" ] 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 debootstrap options if [ -n "${LIVE_ARCHITECTURE}" ] @@ -117,10 +114,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/apt/archives/*.deb cache/packages_bootstrap fi @@ -146,10 +140,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 |