diff options
Diffstat (limited to 'scripts')
60 files changed, 149 insertions, 206 deletions
diff --git a/scripts/build/binary_checksums b/scripts/build/binary_checksums index 5326d4804..93602fbca 100755 --- a/scripts/build/binary_checksums +++ b/scripts/build/binary_checksums @@ -30,8 +30,7 @@ fi Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_checksums" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -88,4 +87,4 @@ find . | sed -e 's|^.||g' | grep "^/" | sort > ../${LIVE_IMAGE_NAME}-${LB_ARCHIT cd "${OLDPWD}" # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_chroot b/scripts/build/binary_chroot index bd4888b8b..b238f05a3 100755 --- a/scripts/build/binary_chroot +++ b/scripts/build/binary_chroot @@ -27,8 +27,7 @@ Echo_message "Begin copying chroot..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_chroot" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -93,4 +92,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk index 4eb0127ba..076dcbfdb 100755 --- a/scripts/build/binary_disk +++ b/scripts/build/binary_disk @@ -35,8 +35,7 @@ Echo_message "Begin installing disk information..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_disk" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -166,4 +165,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index e7e70cb3a..8f1f7c12a 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -29,8 +29,7 @@ Echo_message "Begin preparing Grub based EFI support..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_grub-efi" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -303,4 +302,4 @@ rm -rf chroot/grub-efi-temp # We rely on: binary_loopback_cfg to generate grub.cfg and other configuration files # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy index 8009f939e..4b019bd2e 100755 --- a/scripts/build/binary_grub-legacy +++ b/scripts/build/binary_grub-legacy @@ -29,8 +29,7 @@ Echo_message "Begin installing grub-legacy..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_grub-legacy" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -244,4 +243,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc index 6ef4cbc23..d490f9255 100755 --- a/scripts/build/binary_grub-pc +++ b/scripts/build/binary_grub-pc @@ -29,8 +29,7 @@ Echo_message "Begin installing grub-pc..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_grub" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -87,4 +86,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd index 507f43563..d5a32664d 100755 --- a/scripts/build/binary_hdd +++ b/scripts/build/binary_hdd @@ -32,8 +32,7 @@ Echo_message "Begin building binary hdd image..." Require_stagefile config bootstrap chroot_proc # Checking stage file -STAGE_FILE="binary_hdd" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -355,4 +354,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_hooks b/scripts/build/binary_hooks index 6389cf160..847ecb348 100755 --- a/scripts/build/binary_hooks +++ b/scripts/build/binary_hooks @@ -27,8 +27,7 @@ Echo_message "Begin executing hooks..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_hooks" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -73,4 +72,4 @@ do done # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_includes b/scripts/build/binary_includes index 2b95eef8a..c47ac0f5a 100755 --- a/scripts/build/binary_includes +++ b/scripts/build/binary_includes @@ -27,8 +27,7 @@ Echo_message "Begin copying binary includes..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_includes" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -49,4 +48,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso index b87f9e4c3..b6a1128ee 100755 --- a/scripts/build/binary_iso +++ b/scripts/build/binary_iso @@ -41,8 +41,7 @@ Echo_message "Begin building binary iso image..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_iso" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -243,4 +242,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_linux-image b/scripts/build/binary_linux-image index 123169efb..b4ba87974 100755 --- a/scripts/build/binary_linux-image +++ b/scripts/build/binary_linux-image @@ -32,8 +32,7 @@ Echo_message "Begin install linux-image..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_linux-image" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -75,4 +74,4 @@ case "${LB_INITRAMFS}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_loadlin b/scripts/build/binary_loadlin index 72974a410..c89222935 100755 --- a/scripts/build/binary_loadlin +++ b/scripts/build/binary_loadlin @@ -32,8 +32,7 @@ Echo_message "Begin copying loadlin..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_loadlin" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -89,4 +88,4 @@ EOF esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg index 032d8d28e..80a7f275c 100755 --- a/scripts/build/binary_loopback_cfg +++ b/scripts/build/binary_loopback_cfg @@ -31,8 +31,7 @@ Echo_message "Begin installing loopback.cfg..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_loopback_cfg" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -302,4 +301,4 @@ sed -i -e 's|\ $||g' binary/boot/grub/*.cfg echo "source /boot/grub/grub.cfg" > binary/boot/grub/loopback.cfg # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest index c3fc880cb..b8b38e101 100755 --- a/scripts/build/binary_manifest +++ b/scripts/build/binary_manifest @@ -32,8 +32,7 @@ Echo_message "Begin creating manifest..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_manifest" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -60,4 +59,4 @@ cp chroot.packages.live ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.packages cp chroot.files ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.files # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest index 4b207c6b8..bfdf1e90f 100755 --- a/scripts/build/binary_memtest +++ b/scripts/build/binary_memtest @@ -32,8 +32,7 @@ Echo_message "Begin installing memtest..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_memtest" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -110,4 +109,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot index c2285edda..edb1cfaf1 100755 --- a/scripts/build/binary_netboot +++ b/scripts/build/binary_netboot @@ -37,8 +37,7 @@ Echo_message "Begin building binary netboot image..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_netboot" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -105,4 +104,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_onie b/scripts/build/binary_onie index 60708ccb5..20d4d5389 100755 --- a/scripts/build/binary_onie +++ b/scripts/build/binary_onie @@ -45,8 +45,7 @@ Echo_message "Begin building onie binary..." Require_stagefile config binary_iso # Checking stage file -STAGE_FILE="binary_onie" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -336,4 +335,4 @@ ls -la $(basename $output_file) Echo_message "onie-installer created..." # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_package-lists b/scripts/build/binary_package-lists index 4883781f9..c72fecabc 100755 --- a/scripts/build/binary_package-lists +++ b/scripts/build/binary_package-lists @@ -27,8 +27,7 @@ Echo_message "Begin installing local package lists..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_package-lists" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -176,4 +175,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs index 99c962362..f84bfcc77 100755 --- a/scripts/build/binary_rootfs +++ b/scripts/build/binary_rootfs @@ -27,8 +27,7 @@ Echo_message "Begin building root filesystem image..." Require_stagefile config bootstrap binary_chroot # Checking stage file -STAGE_FILE="binary_rootfs" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -66,7 +65,7 @@ then cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}" # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile exit 0 fi @@ -448,4 +447,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux index 79cb77d9c..1ffe039e2 100755 --- a/scripts/build/binary_syslinux +++ b/scripts/build/binary_syslinux @@ -29,8 +29,7 @@ Echo_message "Begin installing syslinux..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_syslinux" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -338,4 +337,4 @@ case "${LB_BUILD_WITH_CHROOT}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar index 2adf995c8..12b8d3230 100755 --- a/scripts/build/binary_tar +++ b/scripts/build/binary_tar @@ -32,8 +32,7 @@ Echo_message "Begin building binary tarball..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_tar" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -65,4 +64,4 @@ case "${LB_COMPRESSION}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_win32-loader b/scripts/build/binary_win32-loader index 6995ee11d..c1be6333f 100755 --- a/scripts/build/binary_win32-loader +++ b/scripts/build/binary_win32-loader @@ -32,8 +32,7 @@ Echo_message "Begin copying win32-loader..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_win32-loader" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -127,4 +126,4 @@ EOF esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync index 8b5c20017..2e5961743 100755 --- a/scripts/build/binary_zsync +++ b/scripts/build/binary_zsync @@ -37,8 +37,7 @@ Echo_message "Begin building zsync control files..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="binary_zsync" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -122,4 +121,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/bootstrap_archives b/scripts/build/bootstrap_archives index d9c547658..8c828a2d8 100755 --- a/scripts/build/bootstrap_archives +++ b/scripts/build/bootstrap_archives @@ -34,8 +34,7 @@ Require_stagefile config bootstrap Echo_message "Configuring file /etc/apt/sources.list" # Checking stage file -STAGE_FILE="bootstrap_archives" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -156,4 +155,4 @@ Apt chroot "dist-upgrade" Save_package_cache chroot # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache index b80e6661a..8cbf30536 100755 --- a/scripts/build/bootstrap_cache +++ b/scripts/build/bootstrap_cache @@ -29,13 +29,16 @@ then exit 0 fi +_ACTION="${1}" +shift + +# Set non-default stage file name (auto picked up by the functions) # Note, this (plus the applicable extension added below) must match that used in `bootstrap_debootstrap` -STAGE_FILE="bootstrap_cache" +STAGE_FILE="bootstrap_cache.${_ACTION}" -case "${1}" in +case "${_ACTION}" in restore) # Checking stage file - STAGE_FILE="${STAGE_FILE}.restore" Check_stagefile "${STAGE_FILE}" if [ -d cache/bootstrap ] @@ -53,7 +56,7 @@ case "${1}" in # Creating stage file Create_stagefile "${STAGE_FILE}" - Create_stagefile bootstrap + Create_stagefile "bootstrap" exit 0 fi @@ -63,7 +66,6 @@ case "${1}" in Echo_message "Saving bootstrap stage to cache..." # Checking stage file - STAGE_FILE="${STAGE_FILE}.save" Check_stagefile "${STAGE_FILE}" # Acquire lock file diff --git a/scripts/build/bootstrap_debootstrap b/scripts/build/bootstrap_debootstrap index f0262aa8c..fd212bb1e 100755 --- a/scripts/build/bootstrap_debootstrap +++ b/scripts/build/bootstrap_debootstrap @@ -37,10 +37,9 @@ Echo_message "Begin bootstrapping system..." Check_package chroot bin/debootstrap debootstrap # Checking stage file -Check_stagefile bootstrap +Check_stagefile "bootstrap" # Note, this must match that used in `bootstrap_cache` -STAGE_FILE="bootstrap_cache.restore" -Check_stagefile "${STAGE_FILE}" +Check_stagefile "bootstrap_cache.restore" # Acquire lock file Acquire_lockfile @@ -120,4 +119,4 @@ rm -f chroot/etc/hosts rm -f chroot/var/cache/apt/archives/*.deb # Creating stage file -Create_stagefile bootstrap +Create_stagefile "bootstrap" diff --git a/scripts/build/chroot_apt b/scripts/build/chroot_apt index 7d165dcf5..d628ac480 100755 --- a/scripts/build/chroot_apt +++ b/scripts/build/chroot_apt @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_apt" - case "${1}" in install|install-binary) Echo_message "Configuring file /etc/apt/apt.conf" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -207,7 +205,7 @@ EOF esac # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -305,7 +303,7 @@ EOF fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index 751ac664e..a84322117 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -31,14 +31,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_archives" - case "${1}" in install) Echo_message "Configuring file /etc/apt/sources.list" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -314,7 +312,7 @@ case "${1}" in Save_package_cache chroot # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -438,7 +436,7 @@ case "${1}" in rm -f chroot/root/packages.chroot # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_cache b/scripts/build/chroot_cache index 3c9134472..cf526169e 100755 --- a/scripts/build/chroot_cache +++ b/scripts/build/chroot_cache @@ -26,14 +26,18 @@ then exit 0 fi -STAGE_FILE="chroot_cache" +_ACTION="${1}" +shift -case "${1}" in +# Set non-default stage file name (auto picked up by the functions) +# Setting to default name with appended action name +STAGE_FILE="$(Stagefile_name "${_ACTION}")" + +case "${_ACTION}" in restore) Echo_message "Restoring chroot stage from cache..." # Checking stage file - STAGE_FILE="${STAGE_FILE}.restore" Check_stagefile "${STAGE_FILE}" if [ -d cache/chroot ] @@ -58,7 +62,6 @@ case "${1}" in Echo_message "Saving chroot stage to cache..." # Checking stage file - STAGE_FILE="${STAGE_FILE}.save" Check_stagefile "${STAGE_FILE}" # Acquire lock file diff --git a/scripts/build/chroot_debianchroot b/scripts/build/chroot_debianchroot index 2cd8df566..5e3499285 100755 --- a/scripts/build/chroot_debianchroot +++ b/scripts/build/chroot_debianchroot @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_debianchroot" - case "${1}" in install) Echo_message "Configuring file /etc/debian_chroot" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -46,7 +44,7 @@ case "${1}" in echo "live" > chroot/etc/debian_chroot # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -65,7 +63,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_devpts b/scripts/build/chroot_devpts index 89c4daa33..ade3fbe7e 100755 --- a/scripts/build/chroot_devpts +++ b/scripts/build/chroot_devpts @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_devpts" - case "${1}" in install) Echo_message "Begin mounting /dev/pts..." # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -43,7 +41,7 @@ case "${1}" in mount -t devpts -o gid=5,mode=620,x-gvfs-hide devpts-live chroot/dev/pts || true # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -61,7 +59,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg index 32f1aec40..2e5b7a369 100755 --- a/scripts/build/chroot_dpkg +++ b/scripts/build/chroot_dpkg @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_dpkg" - case "${1}" in install) Echo_message "Configuring file /sbin/start-stop-daemon" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -58,7 +56,7 @@ EOF ln -fs /bin/true chroot/usr/sbin/flash-kernel # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -84,7 +82,7 @@ EOF rm -f chroot/etc/dpkg/dpkg.cfg.d/live-build # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware index 190059556..478070f3a 100755 --- a/scripts/build/chroot_firmware +++ b/scripts/build/chroot_firmware @@ -32,8 +32,7 @@ Echo_message "Begin scheduling firmware installation..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_firmware" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -114,4 +113,4 @@ EOF fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_hacks b/scripts/build/chroot_hacks index 1e80d9204..98583558e 100755 --- a/scripts/build/chroot_hacks +++ b/scripts/build/chroot_hacks @@ -27,8 +27,7 @@ Echo_message "Begin executing hacks..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_hacks" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -120,4 +119,4 @@ if [ "${LB_SWAP_FILE_PATH}" ]; then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks index 8868b51c4..0af1db934 100755 --- a/scripts/build/chroot_hooks +++ b/scripts/build/chroot_hooks @@ -27,8 +27,7 @@ Echo_message "Begin executing hooks..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_hooks" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -111,4 +110,4 @@ rmdir chroot/live-build/config rmdir chroot/live-build # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname index 6866336c2..27baf51cb 100755 --- a/scripts/build/chroot_hostname +++ b/scripts/build/chroot_hostname @@ -24,12 +24,10 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_hostname" - case "${1}" in install) # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -53,7 +51,7 @@ EOF chmod 755 chroot/bin/hostname # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -75,7 +73,7 @@ EOF Chroot chroot dpkg-divert --rename --quiet --remove /bin/hostname # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_hosts b/scripts/build/chroot_hosts index 04242ae3b..003b10fca 100755 --- a/scripts/build/chroot_hosts +++ b/scripts/build/chroot_hosts @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_hosts" - case "${1}" in install) Echo_message "Configuring file /etc/hosts" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -57,7 +55,7 @@ EOF fi # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -81,7 +79,7 @@ EOF fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_includes b/scripts/build/chroot_includes index 1508138e4..c0c8e2d62 100755 --- a/scripts/build/chroot_includes +++ b/scripts/build/chroot_includes @@ -27,8 +27,7 @@ Echo_message "Begin copying chroot includes..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="includes.chroot" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -46,4 +45,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_install-packages b/scripts/build/chroot_install-packages index ada5a09c1..42c45f2bf 100755 --- a/scripts/build/chroot_install-packages +++ b/scripts/build/chroot_install-packages @@ -29,8 +29,11 @@ Echo_message "Begin installing packages (${_PASS} pass)..." # Requiring stage file Require_stagefile config bootstrap +# Set non-default stage file name (auto picked up by the functions) +# Setting to default name with appended action name +STAGE_FILE="$(Stagefile_name "${_PASS}")" + # Checking stage file -STAGE_FILE="chroot_install-packages.${_PASS}" Check_stagefile "${STAGE_FILE}" # Acquire lock file diff --git a/scripts/build/chroot_interactive b/scripts/build/chroot_interactive index 9a536c61a..b27c68d31 100755 --- a/scripts/build/chroot_interactive +++ b/scripts/build/chroot_interactive @@ -32,8 +32,7 @@ Echo_message "Begin interactive build..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_interactive" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -54,4 +53,4 @@ case "${LB_INTERACTIVE}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image index 4c39d6f9a..43bf3b3ac 100755 --- a/scripts/build/chroot_linux-image +++ b/scripts/build/chroot_linux-image @@ -32,8 +32,7 @@ Echo_message "Begin scheduling kernel image installation..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_linux-image" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -54,4 +53,4 @@ do done # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_package-lists b/scripts/build/chroot_package-lists index 7b3fd25ef..a069530a9 100755 --- a/scripts/build/chroot_package-lists +++ b/scripts/build/chroot_package-lists @@ -29,8 +29,11 @@ Echo_message "Begin queueing installation of package lists (${_PASS} pass)..." # Requiring stage file Require_stagefile config bootstrap +# Set non-default stage file name (auto picked up by the functions) +# Setting to default name with appended action name +STAGE_FILE="$(Stagefile_name "${_PASS}")" + # Checking stage file -STAGE_FILE="chroot_package-lists.${_PASS}" Check_stagefile "${STAGE_FILE}" # Acquire lock file diff --git a/scripts/build/chroot_preseed b/scripts/build/chroot_preseed index bd0466e1e..a35d178b3 100755 --- a/scripts/build/chroot_preseed +++ b/scripts/build/chroot_preseed @@ -27,8 +27,7 @@ Echo_message "Begin executing local preseeds..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="chroot_preseed" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -79,4 +78,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/chroot_proc b/scripts/build/chroot_proc index 104a2dcc3..a41003ce2 100755 --- a/scripts/build/chroot_proc +++ b/scripts/build/chroot_proc @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_proc" - case "${1}" in install) Echo_message "Begin mounting /proc..." # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -43,7 +41,7 @@ case "${1}" in mount -t proc -o x-gvfs-hide proc-live chroot/proc # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -65,7 +63,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_resolv b/scripts/build/chroot_resolv index d550fea35..dcf798841 100755 --- a/scripts/build/chroot_resolv +++ b/scripts/build/chroot_resolv @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_resolv" - case "${1}" in install) Echo_message "Configuring file /etc/resolv.conf" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -60,7 +58,7 @@ case "${1}" in fi # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -91,7 +89,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_selinuxfs b/scripts/build/chroot_selinuxfs index 77f94e98a..aa94da516 100755 --- a/scripts/build/chroot_selinuxfs +++ b/scripts/build/chroot_selinuxfs @@ -24,8 +24,6 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_selinuxfs" - case "${1}" in install) if [ -e /sys/fs/selinux/enforce ] && [ "$(cat /sys/fs/selinux/enforce)" = "1" ] @@ -33,7 +31,7 @@ case "${1}" in Echo_message "Begin mounting /sys/fs/selinux..." # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -45,7 +43,7 @@ case "${1}" in mount -t selinuxfs -o x-gvfs-hide selinuxfs-live chroot/sys/fs/selinux # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile fi ;; @@ -62,7 +60,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_sysfs b/scripts/build/chroot_sysfs index e4a1d5bb8..23a85bda1 100755 --- a/scripts/build/chroot_sysfs +++ b/scripts/build/chroot_sysfs @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_sysfs" - case "${1}" in install) Echo_message "Begin mounting /sys..." # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -43,7 +41,7 @@ case "${1}" in mount -t sysfs -o x-gvfs-hide sysfs-live chroot/sys # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -59,7 +57,7 @@ case "${1}" in fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_sysv-rc b/scripts/build/chroot_sysv-rc index 2c4ccd252..01a95233d 100755 --- a/scripts/build/chroot_sysv-rc +++ b/scripts/build/chroot_sysv-rc @@ -24,14 +24,12 @@ Init_config_data "${@}" # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_sysv-rc" - case "${1}" in install) Echo_message "Configuring file /usr/sbin/policy-rc.d" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -52,7 +50,7 @@ EOF chmod 0755 chroot/usr/sbin/policy-rc.d # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -71,7 +69,7 @@ EOF fi # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/chroot_tmpfs b/scripts/build/chroot_tmpfs index 9ad643ea2..074ef9422 100755 --- a/scripts/build/chroot_tmpfs +++ b/scripts/build/chroot_tmpfs @@ -29,14 +29,12 @@ fi # Requiring stage file Require_stagefile config bootstrap -STAGE_FILE="chroot_tmpfs" - case "${1}" in install) Echo_message "Configuring tmpfs for /var/lib/dpkg" # Checking stage file - Check_stagefile "${STAGE_FILE}" + Check_stagefile # Acquire lock file Acquire_lockfile @@ -48,7 +46,7 @@ case "${1}" in rm -rf chroot/var/lib/dpkg.tmp # Creating stage file - Create_stagefile "${STAGE_FILE}" + Create_stagefile ;; remove) @@ -64,7 +62,7 @@ case "${1}" in mv chroot/var/lib/dpkg.tmp chroot/var/lib/dpkg # Removing stage file - Remove_stagefile "${STAGE_FILE}" + Remove_stagefile ;; *) diff --git a/scripts/build/config b/scripts/build/config index a344c59e6..e2d8f13f9 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -1513,4 +1513,4 @@ Type: ${LIVE_IMAGE_TYPE} EOF # Creating stage file -Create_stagefile config +Create_stagefile diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 12c05f31e..5e1073851 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -52,8 +52,7 @@ Echo_message "Begin installing debian-installer..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="installer_debian-installer" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -881,4 +880,4 @@ Save_package_cache binary Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/installer_preseed b/scripts/build/installer_preseed index 9aacd9286..5ccdc37aa 100755 --- a/scripts/build/installer_preseed +++ b/scripts/build/installer_preseed @@ -31,8 +31,7 @@ esac Echo_message "Begin including local preseeds..." # Checking stage file -STAGE_FILE="installer_preseed" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -63,4 +62,4 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_checksums b/scripts/build/source_checksums index 4d16adbcf..884219cb2 100755 --- a/scripts/build/source_checksums +++ b/scripts/build/source_checksums @@ -30,8 +30,7 @@ fi Require_stagefile config source_debian # Checking stage file -STAGE_FILE="source_checksums" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -93,4 +92,4 @@ EOF done # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_debian b/scripts/build/source_debian index be3894c16..0a7cfe156 100755 --- a/scripts/build/source_debian +++ b/scripts/build/source_debian @@ -32,8 +32,7 @@ Echo_message "Begin downloading sources..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="source_debian" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -212,5 +211,5 @@ then fi # Creating stage file -Create_stagefile "${STAGE_FILE}" -Create_stagefile source +Create_stagefile +Create_stagefile "source" diff --git a/scripts/build/source_disk b/scripts/build/source_disk index 77f8afade..7e9edd231 100755 --- a/scripts/build/source_disk +++ b/scripts/build/source_disk @@ -36,8 +36,7 @@ Echo_message "Begin installing disk information..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="source_disk" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -119,4 +118,4 @@ case "${LB_DEBIAN_INSTALLER}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_hdd b/scripts/build/source_hdd index f56a15304..d19c05a41 100755 --- a/scripts/build/source_hdd +++ b/scripts/build/source_hdd @@ -37,8 +37,7 @@ Echo_message "Begin building source hdd image..." Require_stagefile config source_debian # Checking stage file -STAGE_FILE="source_hdd" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -149,4 +148,4 @@ fi Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_hooks b/scripts/build/source_hooks index eec474357..4b5554fa1 100755 --- a/scripts/build/source_hooks +++ b/scripts/build/source_hooks @@ -27,8 +27,7 @@ Echo_message "Begin executing hooks..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="source_hooks" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -73,4 +72,4 @@ do done # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_iso b/scripts/build/source_iso index cd861fc98..65a81b218 100755 --- a/scripts/build/source_iso +++ b/scripts/build/source_iso @@ -41,8 +41,7 @@ Echo_message "Begin building source iso image..." Require_stagefile config source_debian # Checking stage file -STAGE_FILE="source_iso" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -115,4 +114,4 @@ rm -f chroot/source.sh Remove_package # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_live b/scripts/build/source_live index e03a37677..7c6f85f9d 100755 --- a/scripts/build/source_live +++ b/scripts/build/source_live @@ -32,8 +32,7 @@ Echo_message "Begin copying live-build configuration..." Require_stagefile config bootstrap # Checking stage file -STAGE_FILE="source_live" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -62,4 +61,4 @@ packages used in the "live" disc). EOF # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile diff --git a/scripts/build/source_tar b/scripts/build/source_tar index cedea3bd1..35446a972 100755 --- a/scripts/build/source_tar +++ b/scripts/build/source_tar @@ -38,8 +38,7 @@ Echo_message "This may take a while." Require_stagefile config source_debian # Checking stage file -STAGE_FILE="source_tar" -Check_stagefile "${STAGE_FILE}" +Check_stagefile # Acquire lock file Acquire_lockfile @@ -77,4 +76,4 @@ case "${LB_COMPRESSION}" in esac # Creating stage file -Create_stagefile "${STAGE_FILE}" +Create_stagefile |