diff options
Diffstat (limited to 'helpers/lh_bootstrap_debootstrap')
-rwxr-xr-x | helpers/lh_bootstrap_debootstrap | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index 43fdd96..0538422 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 |