summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/binary_rootfs44
-rwxr-xr-xscripts/build/bootstrap_cache83
-rwxr-xr-xscripts/build/chroot_cache81
3 files changed, 100 insertions, 108 deletions
diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs
index 77f466c07..716615860 100755
--- a/scripts/build/binary_rootfs
+++ b/scripts/build/binary_rootfs
@@ -61,22 +61,19 @@ esac
# Creating directory
mkdir -p binary/${INITFS}
-for STAGE in ${LB_CACHE_STAGES}
-do
- if [ "${STAGE}" = "rootfs" ] && [ -d cache/binary_rootfs ]
- then
- # Removing old chroot
- rm -rf binary/"${INITFS}"/filesystem.*
+if In_list "rootfs" ${LB_CACHE_STAGES} && [ -d cache/binary_rootfs ]
+then
+ # Removing old chroot
+ rm -rf binary/"${INITFS}"/filesystem.*
- # Restoring old cache
- mkdir -p binary/"${INITFS}"
- cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}"
+ # Restoring old cache
+ mkdir -p binary/"${INITFS}"
+ cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}"
- # Creating stage file
- Create_stagefile .build/binary_rootfs
- exit 0
- fi
-done
+ # Creating stage file
+ Create_stagefile .build/binary_rootfs
+ exit 0
+fi
case "${LB_CHROOT_FILESYSTEM}" in
ext2|ext3|ext4)
@@ -443,20 +440,17 @@ case "${LB_CHROOT_FILESYSTEM}" in
esac
-for STAGE in ${LB_CACHE_STAGES}
-do
- if [ "${STAGE}" = "rootfs" ]
- then
- rm -rf cache/binary_rootfs
+if In_list "rootfs" ${LB_CACHE_STAGES}
+then
+ rm -rf cache/binary_rootfs
- mkdir -p cache/binary_rootfs
+ mkdir -p cache/binary_rootfs
- if [ "${LB_CHROOT_FILESYSTEM}" != "none" ]
- then
- cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs
- fi
+ if [ "${LB_CHROOT_FILESYSTEM}" != "none" ]
+ then
+ cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs
fi
-done
+fi
# Creating stage file
Create_stagefile .build/binary_rootfs
diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache
index 694ba9dee..b76177b33 100755
--- a/scripts/build/bootstrap_cache
+++ b/scripts/build/bootstrap_cache
@@ -27,60 +27,59 @@ Set_defaults
# Check architecture
Check_crossarchitectures
-for STAGE in ${LB_CACHE_STAGES}
-do
- if [ "${STAGE}" = "bootstrap" ]
- then
- case "${1}" in
- restore)
- # Checking stage file
- Check_stagefile .build/bootstrap_cache.restore
+if ! In_list "bootstrap" ${LB_CACHE_STAGES}
+then
+ exit 0
+fi
- if [ -d cache/bootstrap ]
- then
- Echo_message "Restoring bootstrap stage from cache..."
+case "${1}" in
+ restore)
+ # Checking stage file
+ Check_stagefile .build/bootstrap_cache.restore
- # Checking lock file
- Check_lockfile .lock
+ if [ -d cache/bootstrap ]
+ then
+ Echo_message "Restoring bootstrap stage from cache..."
- # Creating lock file
- Create_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- # Removing old chroot
- rm -rf chroot
+ # Creating lock file
+ Create_lockfile .lock
- # Restoring old cache
- cp -a cache/bootstrap chroot
+ # Removing old chroot
+ rm -rf chroot
- # Creating stage file
- Create_stagefile .build/bootstrap_cache.restore
- Create_stagefile .build/bootstrap
+ # Restoring old cache
+ cp -a cache/bootstrap chroot
- exit 0
- fi
- ;;
+ # Creating stage file
+ Create_stagefile .build/bootstrap_cache.restore
+ Create_stagefile .build/bootstrap
- save)
- Echo_message "Saving bootstrap stage to cache..."
+ exit 0
+ fi
+ ;;
- # Checking stage file
- Check_stagefile .build/bootstrap_cache.save
+ save)
+ Echo_message "Saving bootstrap stage to cache..."
- # Checking lock file
- Check_lockfile .lock
+ # Checking stage file
+ Check_stagefile .build/bootstrap_cache.save
- # Creating lock file
- Create_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- rm -rf cache/bootstrap
+ # Creating lock file
+ Create_lockfile .lock
- mkdir -p cache
+ rm -rf cache/bootstrap
- cp -a chroot cache/bootstrap
+ mkdir -p cache
- # Creating stage file
- Create_stagefile .build/bootstrap_cache.save
- ;;
- esac
- fi
-done
+ cp -a chroot cache/bootstrap
+
+ # Creating stage file
+ Create_stagefile .build/bootstrap_cache.save
+ ;;
+esac
diff --git a/scripts/build/chroot_cache b/scripts/build/chroot_cache
index 4adca2008..caffcdce1 100755
--- a/scripts/build/chroot_cache
+++ b/scripts/build/chroot_cache
@@ -24,59 +24,58 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
-for STAGE in ${LB_CACHE_STAGES}
-do
- if [ "${STAGE}" = "chroot" ]
- then
- case "${1}" in
- restore)
- Echo_message "Restoring chroot stage from cache..."
+if ! In_list "chroot" ${LB_CACHE_STAGES}
+then
+ exit 0
+fi
- # Checking stage file
- Check_stagefile .build/chroot_cache.restore
+case "${1}" in
+ restore)
+ Echo_message "Restoring chroot stage from cache..."
- if [ -d cache/chroot ]
- then
- # Checking lock file
- Check_lockfile .lock
+ # Checking stage file
+ Check_stagefile .build/chroot_cache.restore
- # Creating lock file
- Create_lockfile .lock
+ if [ -d cache/chroot ]
+ then
+ # Checking lock file
+ Check_lockfile .lock
- # Removing old chroot
- rm -rf chroot
+ # Creating lock file
+ Create_lockfile .lock
- # Restoring old cache
- cp -a cache/chroot chroot
+ # Removing old chroot
+ rm -rf chroot
- # Creating stage file
- Create_stagefile .build/chroot_cache.restore
+ # Restoring old cache
+ cp -a cache/chroot chroot
- exit 0
- fi
- ;;
+ # Creating stage file
+ Create_stagefile .build/chroot_cache.restore
- save)
- Echo_message "Saving chroot stage to cache..."
+ exit 0
+ fi
+ ;;
- # Checking stage file
- Check_stagefile .build/chroot_cache.save
+ save)
+ Echo_message "Saving chroot stage to cache..."
- # Checking lock file
- Check_lockfile .lock
+ # Checking stage file
+ Check_stagefile .build/chroot_cache.save
- # Creating lock file
- Create_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- rm -rf cache/chroot
+ # Creating lock file
+ Create_lockfile .lock
- mkdir -p cache
+ rm -rf cache/chroot
- cp -a chroot cache/chroot
+ mkdir -p cache
- # Creating stage file
- Create_stagefile .build/chroot_cache.save
- ;;
- esac
- fi
-done
+ cp -a chroot cache/chroot
+
+ # Creating stage file
+ Create_stagefile .build/chroot_cache.save
+ ;;
+esac