summaryrefslogtreecommitdiff
path: root/scripts/build/lb_bootstrap_cache
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-12-05 15:33:54 +0100
committerDaniel Baumann <daniel@debian.org>2010-12-06 14:19:23 +0100
commit70e84bd3c188e0941a991084469df1407005072c (patch)
treeb5fada7d680dc0e413c2b17d99c378e223b8128f /scripts/build/lb_bootstrap_cache
parent47ce1c19d0945fec7325ce5ed961aed55972d159 (diff)
downloadvyos-live-build-70e84bd3c188e0941a991084469df1407005072c.tar.gz
vyos-live-build-70e84bd3c188e0941a991084469df1407005072c.zip
Updating bootstrap for multiarch.
Diffstat (limited to 'scripts/build/lb_bootstrap_cache')
-rwxr-xr-xscripts/build/lb_bootstrap_cache101
1 files changed, 52 insertions, 49 deletions
diff --git a/scripts/build/lb_bootstrap_cache b/scripts/build/lb_bootstrap_cache
index 755baad01..6672668c7 100755
--- a/scripts/build/lb_bootstrap_cache
+++ b/scripts/build/lb_bootstrap_cache
@@ -27,68 +27,71 @@ Set_defaults
# Check architecture
Check_crossarchitectures
-Echo_message "Begin caching bootstrap stage..."
-
-for STAGE in ${LB_CACHE_STAGES}
+for _ARCHITECTURE in ${LB_ARCHITECTURES}
do
- if [ "${STAGE}" = "bootstrap" ]
- then
- case "${1}" in
- restore)
- # Checking stage file
- Check_stagefile .stage/bootstrap_cache.restore
-
- if [ -d cache/stages_bootstrap ]
- then
- # Checking lock file
- Check_lockfile .lock
+ Echo_message "Begin caching bootstrap stage..."
+
+ for STAGE in ${LB_CACHE_STAGES}
+ do
+ if [ "${STAGE}" = "bootstrap" ]
+ then
+ case "${1}" in
+ restore)
+ # Checking stage file
+ Check_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-restore
+
+ if [ -d cache/stages_bootstrap.${_ARCHITECTURE} ]
+ then
+ # Checking lock file
+ Check_lockfile .lock
- # Creating lock file
- Create_lockfile .lock
+ # Creating lock file
+ Create_lockfile .lock
- # Removing old chroot
- rm -rf chroot
+ # Removing old chroot
+ rm -rf chroot.${_ARCHITECTURE}
- # Restoring old cache
- ${LB_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot
+ # Restoring old cache
+ ${LB_ROOT_COMMAND} cp -a cache/stages_bootstrap.${_ARCHITECTURE} chroot.${_ARCHITECTURE}
- if [ -n "${LB_ROOT_COMMAND}" ]
- then
- ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) chroot
- fi
+ if [ -n "${LB_ROOT_COMMAND}" ]
+ then
+ ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) chroot.${_ARCHITECTURE}
+ fi
- # Creating stage file
- Create_stagefile .stage/bootstrap_cache.restore
- Create_stagefile .stage/bootstrap
+ # Creating stage file
+ Create_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-restore
+ Create_stagefile .stage/bootstrap.${_ARCHITECTURE}
- exit 0
- fi
- ;;
+ exit 0
+ fi
+ ;;
- save)
- # Checking stage file
- Check_stagefile .stage/bootstrap_cache.save
+ save)
+ # Checking stage file
+ Check_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-save
- # Checking lock file
- Check_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- # Creating lock file
- Create_lockfile .lock
+ # Creating lock file
+ Create_lockfile .lock
- rm -rf cache/stages_bootstrap
+ rm -rf cache/stages_bootstrap.${_ARCHITECTURE}
- mkdir -p cache
+ mkdir -p cache
- ${LB_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap
+ ${LB_ROOT_COMMAND} cp -a chroot.${_ARCHITECTURE} cache/stages_bootstrap.${_ARCHITECTURE}
- if [ -n "${LB_ROOT_COMMAND}" ]
- then
- ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) cache/stages_bootstrap
- fi
+ if [ -n "${LB_ROOT_COMMAND}" ]
+ then
+ ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) cache/stages_bootstrap.${_ARCHITECTURE}
+ fi
- # Creating stage file
- Create_stagefile .stage/bootstrap_cache.save
- ;;
- esac
- fi
+ # Creating stage file
+ Create_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-save
+ ;;
+ esac
+ fi
+ done
done