summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-12 01:21:39 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-03-17 18:57:02 +0000
commit04d9ee0211e7cf2d5f637941ff6579b4f5462da6 (patch)
tree17d1ccea5c085c5afd62361d2fe97a14c951cb9b
parentbea349c82237ee165baaf1f7e8043a26e0c14417 (diff)
downloadvyos-live-build-04d9ee0211e7cf2d5f637941ff6579b4f5462da6.tar.gz
vyos-live-build-04d9ee0211e7cf2d5f637941ff6579b4f5462da6.zip
stagefiles: simplify & robustify
- avoid all need to pass ".build/" path in stage file names into the functions - add a helper to remove a stage file (required to complete the above properly) - avoid duplicating filenames within scripts which makes them prone to mistakes (some instances of which I've actually encountered and had to fix) Gbp-Dch: Short
-rwxr-xr-xfunctions/stagefile.sh14
-rwxr-xr-xscripts/build/binary3
-rwxr-xr-xscripts/build/binary_checksums7
-rwxr-xr-xscripts/build/binary_chroot7
-rwxr-xr-xscripts/build/binary_disk7
-rwxr-xr-xscripts/build/binary_grub-efi7
-rwxr-xr-xscripts/build/binary_grub-legacy7
-rwxr-xr-xscripts/build/binary_grub-pc7
-rwxr-xr-xscripts/build/binary_hdd7
-rwxr-xr-xscripts/build/binary_hooks7
-rwxr-xr-xscripts/build/binary_includes7
-rwxr-xr-xscripts/build/binary_iso7
-rwxr-xr-xscripts/build/binary_linux-image7
-rwxr-xr-xscripts/build/binary_loadlin7
-rwxr-xr-xscripts/build/binary_loopback_cfg7
-rwxr-xr-xscripts/build/binary_manifest7
-rwxr-xr-xscripts/build/binary_memtest7
-rwxr-xr-xscripts/build/binary_netboot7
-rwxr-xr-xscripts/build/binary_onie7
-rwxr-xr-xscripts/build/binary_package-lists7
-rwxr-xr-xscripts/build/binary_rootfs9
-rwxr-xr-xscripts/build/binary_syslinux7
-rwxr-xr-xscripts/build/binary_tar7
-rwxr-xr-xscripts/build/binary_win32-loader7
-rwxr-xr-xscripts/build/binary_zsync7
-rwxr-xr-xscripts/build/bootstrap_archives7
-rwxr-xr-xscripts/build/bootstrap_cache15
-rwxr-xr-xscripts/build/bootstrap_debootstrap8
-rwxr-xr-xscripts/build/chroot_apt10
-rwxr-xr-xscripts/build/chroot_archives10
-rwxr-xr-xscripts/build/chroot_cache12
-rwxr-xr-xscripts/build/chroot_debianchroot10
-rwxr-xr-xscripts/build/chroot_devpts10
-rwxr-xr-xscripts/build/chroot_dpkg10
-rwxr-xr-xscripts/build/chroot_firmware7
-rwxr-xr-xscripts/build/chroot_hacks7
-rwxr-xr-xscripts/build/chroot_hooks7
-rwxr-xr-xscripts/build/chroot_hostname10
-rwxr-xr-xscripts/build/chroot_hosts10
-rwxr-xr-xscripts/build/chroot_includes7
-rwxr-xr-xscripts/build/chroot_install-packages7
-rwxr-xr-xscripts/build/chroot_interactive7
-rwxr-xr-xscripts/build/chroot_linux-image7
-rwxr-xr-xscripts/build/chroot_package-lists7
-rwxr-xr-xscripts/build/chroot_preseed7
-rwxr-xr-xscripts/build/chroot_proc10
-rwxr-xr-xscripts/build/chroot_resolv10
-rwxr-xr-xscripts/build/chroot_selinuxfs10
-rwxr-xr-xscripts/build/chroot_sysfs10
-rwxr-xr-xscripts/build/chroot_sysv-rc10
-rwxr-xr-xscripts/build/chroot_tmpfs10
-rwxr-xr-xscripts/build/config2
-rwxr-xr-xscripts/build/installer_debian-installer7
-rwxr-xr-xscripts/build/installer_preseed5
-rwxr-xr-xscripts/build/source_checksums7
-rwxr-xr-xscripts/build/source_debian9
-rwxr-xr-xscripts/build/source_disk7
-rwxr-xr-xscripts/build/source_hdd7
-rwxr-xr-xscripts/build/source_hooks7
-rwxr-xr-xscripts/build/source_iso7
-rwxr-xr-xscripts/build/source_live7
-rwxr-xr-xscripts/build/source_tar7
62 files changed, 287 insertions, 200 deletions
diff --git a/functions/stagefile.sh b/functions/stagefile.sh
index 9ef4789c9..f51144bd3 100755
--- a/functions/stagefile.sh
+++ b/functions/stagefile.sh
@@ -11,8 +11,8 @@
Check_stagefile ()
{
- FILE="${1}"
- NAME="$(basename ${1})"
+ FILE=".build/${1}"
+ NAME="$(basename ${FILE})"
# Checking stage file
if [ -f "${FILE}" ]
@@ -32,8 +32,8 @@ Check_stagefile ()
Create_stagefile ()
{
- FILE="${1}"
- DIRECTORY="$(dirname ${1})"
+ FILE=".build/${1}"
+ DIRECTORY="$(dirname ${FILE})"
# Creating stage directory
mkdir -p "${DIRECTORY}"
@@ -42,6 +42,11 @@ Create_stagefile ()
touch "${FILE}"
}
+Remove_stagefile ()
+{
+ rm -f ".build/${1}"
+}
+
Require_stagefile ()
{
local NAME
@@ -55,6 +60,7 @@ Require_stagefile ()
local CONTINUE=false
for FILE in ${FILES}
do
+ FILE=".build/${FILE}"
# Find at least one of the required stages
if [ -f ${FILE} ]
then
diff --git a/scripts/build/binary b/scripts/build/binary
index 07863073e..e1d28a241 100755
--- a/scripts/build/binary
+++ b/scripts/build/binary
@@ -86,7 +86,8 @@ lb binary_zsync ${@}
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
then
# Deconfiguring chroot
- rm -f .build/chroot_archives
+ Remove_stagefile chroot_archives
+
lb chroot_apt remove ${@}
lb chroot_hostname remove ${@}
lb chroot_resolv remove ${@}
diff --git a/scripts/build/binary_checksums b/scripts/build/binary_checksums
index 44cfcbc28..5326d4804 100755
--- a/scripts/build/binary_checksums
+++ b/scripts/build/binary_checksums
@@ -27,10 +27,11 @@ then
fi
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_checksums
+STAGE_FILE="binary_checksums"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -87,4 +88,4 @@ find . | sed -e 's|^.||g' | grep "^/" | sort > ../${LIVE_IMAGE_NAME}-${LB_ARCHIT
cd "${OLDPWD}"
# Creating stage file
-Create_stagefile .build/binary_checksums
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_chroot b/scripts/build/binary_chroot
index e57d8c065..bd4888b8b 100755
--- a/scripts/build/binary_chroot
+++ b/scripts/build/binary_chroot
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin copying chroot..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_chroot
+STAGE_FILE="binary_chroot"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -92,4 +93,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_chroot
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk
index d0df2beda..4eb0127ba 100755
--- a/scripts/build/binary_disk
+++ b/scripts/build/binary_disk
@@ -32,10 +32,11 @@ esac
Echo_message "Begin installing disk information..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_disk
+STAGE_FILE="binary_disk"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -165,4 +166,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_disk
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi
index f85f43ad4..e7e70cb3a 100755
--- a/scripts/build/binary_grub-efi
+++ b/scripts/build/binary_grub-efi
@@ -26,10 +26,11 @@ Check_Any_Bootloader_Role "grub-efi"
Echo_message "Begin preparing Grub based EFI support..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_grub-efi
+STAGE_FILE="binary_grub-efi"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -302,4 +303,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 .build/binary_grub-efi
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy
index fd54e7f64..8009f939e 100755
--- a/scripts/build/binary_grub-legacy
+++ b/scripts/build/binary_grub-legacy
@@ -26,10 +26,11 @@ Check_First_Bootloader_Role "grub-legacy"
Echo_message "Begin installing grub-legacy..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_grub-legacy
+STAGE_FILE="binary_grub-legacy"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -243,4 +244,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/binary_grub-legacy
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index c06e92c38..6ef4cbc23 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -26,10 +26,11 @@ Check_Any_Bootloader_Role "grub-pc"
Echo_message "Begin installing grub-pc..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_grub
+STAGE_FILE="binary_grub"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -86,4 +87,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/binary_grub
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index bc9c61672..507f43563 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -29,10 +29,11 @@ fi
Echo_message "Begin building binary hdd image..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap .build/chroot_proc
+Require_stagefile config bootstrap chroot_proc
# Checking stage file
-Check_stagefile .build/binary_hdd
+STAGE_FILE="binary_hdd"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -354,4 +355,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/binary_hdd
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_hooks b/scripts/build/binary_hooks
index b7f2bb237..6389cf160 100755
--- a/scripts/build/binary_hooks
+++ b/scripts/build/binary_hooks
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin executing hooks..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_hooks
+STAGE_FILE="binary_hooks"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -72,4 +73,4 @@ do
done
# Creating stage file
-Create_stagefile .build/binary_hooks
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_includes b/scripts/build/binary_includes
index 2c7babf4e..2b95eef8a 100755
--- a/scripts/build/binary_includes
+++ b/scripts/build/binary_includes
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin copying binary includes..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_includes
+STAGE_FILE="binary_includes"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -48,4 +49,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_includes
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index e960f798b..b87f9e4c3 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -38,10 +38,11 @@ esac
Echo_message "Begin building binary iso image..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_iso
+STAGE_FILE="binary_iso"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -242,4 +243,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/binary_iso
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_linux-image b/scripts/build/binary_linux-image
index 562eed972..123169efb 100755
--- a/scripts/build/binary_linux-image
+++ b/scripts/build/binary_linux-image
@@ -29,10 +29,11 @@ fi
Echo_message "Begin install linux-image..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_linux-image
+STAGE_FILE="binary_linux-image"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -74,4 +75,4 @@ case "${LB_INITRAMFS}" in
esac
# Creating stage file
-Create_stagefile .build/binary_linux-image
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_loadlin b/scripts/build/binary_loadlin
index c26bf9d3b..72974a410 100755
--- a/scripts/build/binary_loadlin
+++ b/scripts/build/binary_loadlin
@@ -29,10 +29,11 @@ fi
Echo_message "Begin copying loadlin..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_loadlin
+STAGE_FILE="binary_loadlin"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -88,4 +89,4 @@ EOF
esac
# Creating stage file
-Create_stagefile .build/binary_loadlin
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg
index 62681603a..032d8d28e 100755
--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_loopback_cfg
@@ -28,10 +28,11 @@ Init_config_data "${@}"
Echo_message "Begin installing loopback.cfg..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_loopback_cfg
+STAGE_FILE="binary_loopback_cfg"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -301,4 +302,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 .build/binary_loopback_cfg
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest
index 01d356aa6..c3fc880cb 100755
--- a/scripts/build/binary_manifest
+++ b/scripts/build/binary_manifest
@@ -29,10 +29,11 @@ fi
Echo_message "Begin creating manifest..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_manifest
+STAGE_FILE="binary_manifest"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -59,4 +60,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 .build/binary_manifest
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest
index 6b8e7297b..4b207c6b8 100755
--- a/scripts/build/binary_memtest
+++ b/scripts/build/binary_memtest
@@ -29,10 +29,11 @@ fi
Echo_message "Begin installing memtest..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_memtest
+STAGE_FILE="binary_memtest"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -109,4 +110,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_memtest
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot
index a10ea8127..c2285edda 100755
--- a/scripts/build/binary_netboot
+++ b/scripts/build/binary_netboot
@@ -34,10 +34,11 @@ fi
Echo_message "Begin building binary netboot image..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_netboot
+STAGE_FILE="binary_netboot"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -104,4 +105,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_netboot
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_onie b/scripts/build/binary_onie
index 93e55d31b..60708ccb5 100755
--- a/scripts/build/binary_onie
+++ b/scripts/build/binary_onie
@@ -42,10 +42,11 @@ esac
Echo_message "Begin building onie binary..."
# Requiring stage file
-Require_stagefile .build/config .build/binary_iso
+Require_stagefile config binary_iso
# Checking stage file
-Check_stagefile .build/binary_onie
+STAGE_FILE="binary_onie"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -335,4 +336,4 @@ ls -la $(basename $output_file)
Echo_message "onie-installer created..."
# Creating stage file
-Create_stagefile .build/binary_onie
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_package-lists b/scripts/build/binary_package-lists
index ec100613a..4883781f9 100755
--- a/scripts/build/binary_package-lists
+++ b/scripts/build/binary_package-lists
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin installing local package lists..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_package-lists
+STAGE_FILE="binary_package-lists"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -175,4 +176,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_package-lists
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs
index 806cf8613..99c962362 100755
--- a/scripts/build/binary_rootfs
+++ b/scripts/build/binary_rootfs
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin building root filesystem image..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap .build/binary_chroot
+Require_stagefile config bootstrap binary_chroot
# Checking stage file
-Check_stagefile .build/binary_rootfs
+STAGE_FILE="binary_rootfs"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -65,7 +66,7 @@ then
cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}"
# Creating stage file
- Create_stagefile .build/binary_rootfs
+ Create_stagefile "${STAGE_FILE}"
exit 0
fi
@@ -447,4 +448,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/binary_rootfs
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index bf3438635..79cb77d9c 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -26,10 +26,11 @@ Check_Any_Bootloader_Role "syslinux"
Echo_message "Begin installing syslinux..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_syslinux
+STAGE_FILE="binary_syslinux"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -337,4 +338,4 @@ case "${LB_BUILD_WITH_CHROOT}" in
esac
# Creating stage file
-Create_stagefile .build/binary_syslinux
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar
index 8fa34a827..2adf995c8 100755
--- a/scripts/build/binary_tar
+++ b/scripts/build/binary_tar
@@ -29,10 +29,11 @@ fi
Echo_message "Begin building binary tarball..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_tar
+STAGE_FILE="binary_tar"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -64,4 +65,4 @@ case "${LB_COMPRESSION}" in
esac
# Creating stage file
-Create_stagefile .build/binary_tar
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_win32-loader b/scripts/build/binary_win32-loader
index 344c52daf..6995ee11d 100755
--- a/scripts/build/binary_win32-loader
+++ b/scripts/build/binary_win32-loader
@@ -29,10 +29,11 @@ fi
Echo_message "Begin copying win32-loader..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_win32-loader
+STAGE_FILE="binary_win32-loader"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -126,4 +127,4 @@ EOF
esac
# Creating stage file
-Create_stagefile .build/binary_win32-loader
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync
index 35c20748d..8b5c20017 100755
--- a/scripts/build/binary_zsync
+++ b/scripts/build/binary_zsync
@@ -34,10 +34,11 @@ fi
Echo_message "Begin building zsync control files..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/binary_zsync
+STAGE_FILE="binary_zsync"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -121,4 +122,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/binary_zsync
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/bootstrap_archives b/scripts/build/bootstrap_archives
index deeebf631..d9c547658 100755
--- a/scripts/build/bootstrap_archives
+++ b/scripts/build/bootstrap_archives
@@ -29,12 +29,13 @@ fi
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
Echo_message "Configuring file /etc/apt/sources.list"
# Checking stage file
-Check_stagefile .build/bootstrap_archives
+STAGE_FILE="bootstrap_archives"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -155,4 +156,4 @@ Apt chroot "dist-upgrade"
Save_package_cache chroot
# Creating stage file
-Create_stagefile .build/bootstrap_archives
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache
index 8f8f4ac4d..b80e6661a 100755
--- a/scripts/build/bootstrap_cache
+++ b/scripts/build/bootstrap_cache
@@ -29,10 +29,14 @@ then
exit 0
fi
+# Note, this (plus the applicable extension added below) must match that used in `bootstrap_debootstrap`
+STAGE_FILE="bootstrap_cache"
+
case "${1}" in
restore)
# Checking stage file
- Check_stagefile .build/bootstrap_cache.restore
+ STAGE_FILE="${STAGE_FILE}.restore"
+ Check_stagefile "${STAGE_FILE}"
if [ -d cache/bootstrap ]
then
@@ -48,8 +52,8 @@ case "${1}" in
cp -a cache/bootstrap chroot
# Creating stage file
- Create_stagefile .build/bootstrap_cache.restore
- Create_stagefile .build/bootstrap
+ Create_stagefile "${STAGE_FILE}"
+ Create_stagefile bootstrap
exit 0
fi
@@ -59,7 +63,8 @@ case "${1}" in
Echo_message "Saving bootstrap stage to cache..."
# Checking stage file
- Check_stagefile .build/bootstrap_cache.save
+ STAGE_FILE="${STAGE_FILE}.save"
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -71,6 +76,6 @@ case "${1}" in
cp -a chroot cache/bootstrap
# Creating stage file
- Create_stagefile .build/bootstrap_cache.save
+ Create_stagefile "${STAGE_FILE}"
;;
esac
diff --git a/scripts/build/bootstrap_debootstrap b/scripts/build/bootstrap_debootstrap
index 697a093bb..f0262aa8c 100755
--- a/scripts/build/bootstrap_debootstrap
+++ b/scripts/build/bootstrap_debootstrap
@@ -37,8 +37,10 @@ Echo_message "Begin bootstrapping system..."
Check_package chroot bin/debootstrap debootstrap
# Checking stage file
-Check_stagefile .build/bootstrap
-Check_stagefile .build/bootstrap_cache.restore
+Check_stagefile bootstrap
+# Note, this must match that used in `bootstrap_cache`
+STAGE_FILE="bootstrap_cache.restore"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -118,4 +120,4 @@ rm -f chroot/etc/hosts
rm -f chroot/var/cache/apt/archives/*.deb
# Creating stage file
-Create_stagefile .build/bootstrap
+Create_stagefile bootstrap
diff --git a/scripts/build/chroot_apt b/scripts/build/chroot_apt
index 6aee8ccdd..7d165dcf5 100755
--- a/scripts/build/chroot_apt
+++ b/scripts/build/chroot_apt
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|install-binary|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+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 .build/chroot_apt
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -205,7 +207,7 @@ EOF
esac
# Creating stage file
- Create_stagefile .build/chroot_apt
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -303,7 +305,7 @@ EOF
fi
# Removing stage file
- rm -f .build/chroot_apt
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives
index 4f8423682..751ac664e 100755
--- a/scripts/build/chroot_archives
+++ b/scripts/build/chroot_archives
@@ -29,14 +29,16 @@ fi
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+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 .build/chroot_archives
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -312,7 +314,7 @@ case "${1}" in
Save_package_cache chroot
# Creating stage file
- Create_stagefile .build/chroot_archives
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -436,7 +438,7 @@ case "${1}" in
rm -f chroot/root/packages.chroot
# Removing stage file
- rm -f .build/chroot_archives
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_cache b/scripts/build/chroot_cache
index d58ffea1f..3c9134472 100755
--- a/scripts/build/chroot_cache
+++ b/scripts/build/chroot_cache
@@ -26,12 +26,15 @@ then
exit 0
fi
+STAGE_FILE="chroot_cache"
+
case "${1}" in
restore)
Echo_message "Restoring chroot stage from cache..."
# Checking stage file
- Check_stagefile .build/chroot_cache.restore
+ STAGE_FILE="${STAGE_FILE}.restore"
+ Check_stagefile "${STAGE_FILE}"
if [ -d cache/chroot ]
then
@@ -45,7 +48,7 @@ case "${1}" in
cp -a cache/chroot chroot
# Creating stage file
- Create_stagefile .build/chroot_cache.restore
+ Create_stagefile "${STAGE_FILE}"
exit 0
fi
@@ -55,7 +58,8 @@ case "${1}" in
Echo_message "Saving chroot stage to cache..."
# Checking stage file
- Check_stagefile .build/chroot_cache.save
+ STAGE_FILE="${STAGE_FILE}.save"
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -67,6 +71,6 @@ case "${1}" in
cp -a chroot cache/chroot
# Creating stage file
- Create_stagefile .build/chroot_cache.save
+ Create_stagefile "${STAGE_FILE}"
;;
esac
diff --git a/scripts/build/chroot_debianchroot b/scripts/build/chroot_debianchroot
index ddad26793..2cd8df566 100755
--- a/scripts/build/chroot_debianchroot
+++ b/scripts/build/chroot_debianchroot
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_debianchroot"
case "${1}" in
install)
Echo_message "Configuring file /etc/debian_chroot"
# Checking stage file
- Check_stagefile .build/chroot_debianchroot
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -44,7 +46,7 @@ case "${1}" in
echo "live" > chroot/etc/debian_chroot
# Creating stage file
- Create_stagefile .build/chroot_debianchroot
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -63,7 +65,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_debianchroot
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_devpts b/scripts/build/chroot_devpts
index 4650efe18..89c4daa33 100755
--- a/scripts/build/chroot_devpts
+++ b/scripts/build/chroot_devpts
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_devpts"
case "${1}" in
install)
Echo_message "Begin mounting /dev/pts..."
# Checking stage file
- Check_stagefile .build/chroot_devpts
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -41,7 +43,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 .build/chroot_devpts
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -59,7 +61,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_devpts
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg
index 88677dcc7..32f1aec40 100755
--- a/scripts/build/chroot_dpkg
+++ b/scripts/build/chroot_dpkg
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+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 .build/chroot_dpkg
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -56,7 +58,7 @@ EOF
ln -fs /bin/true chroot/usr/sbin/flash-kernel
# Creating stage file
- Create_stagefile .build/chroot_dpkg
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -82,7 +84,7 @@ EOF
rm -f chroot/etc/dpkg/dpkg.cfg.d/live-build
# Removing stage file
- rm -f .build/chroot_dpkg
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware
index 53b62cea5..190059556 100755
--- a/scripts/build/chroot_firmware
+++ b/scripts/build/chroot_firmware
@@ -29,10 +29,11 @@ fi
Echo_message "Begin scheduling firmware installation..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_firmware
+STAGE_FILE="chroot_firmware"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -113,4 +114,4 @@ EOF
fi
# Creating stage file
-Create_stagefile .build/chroot_firmware
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_hacks b/scripts/build/chroot_hacks
index 79be19b96..1e80d9204 100755
--- a/scripts/build/chroot_hacks
+++ b/scripts/build/chroot_hacks
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin executing hacks..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_hacks
+STAGE_FILE="chroot_hacks"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -119,4 +120,4 @@ if [ "${LB_SWAP_FILE_PATH}" ]; then
fi
# Creating stage file
-Create_stagefile .build/chroot_hacks
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks
index 67d164bce..8868b51c4 100755
--- a/scripts/build/chroot_hooks
+++ b/scripts/build/chroot_hooks
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin executing hooks..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_hooks
+STAGE_FILE="chroot_hooks"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -110,4 +111,4 @@ rmdir chroot/live-build/config
rmdir chroot/live-build
# Creating stage file
-Create_stagefile .build/chroot_hooks
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname
index 33663d056..6866336c2 100755
--- a/scripts/build/chroot_hostname
+++ b/scripts/build/chroot_hostname
@@ -22,12 +22,14 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_hostname"
case "${1}" in
install)
# Checking stage file
- Check_stagefile .build/chroot_hostname
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -51,7 +53,7 @@ EOF
chmod 755 chroot/bin/hostname
# Creating stage file
- Create_stagefile .build/chroot_hostname
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -73,7 +75,7 @@ EOF
Chroot chroot dpkg-divert --rename --quiet --remove /bin/hostname
# Removing stage file
- rm -f .build/chroot_hostname
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_hosts b/scripts/build/chroot_hosts
index b6b2de1fa..04242ae3b 100755
--- a/scripts/build/chroot_hosts
+++ b/scripts/build/chroot_hosts
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_hosts"
case "${1}" in
install)
Echo_message "Configuring file /etc/hosts"
# Checking stage file
- Check_stagefile .build/chroot_hosts
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -55,7 +57,7 @@ EOF
fi
# Creating stage file
- Create_stagefile .build/chroot_hosts
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -79,7 +81,7 @@ EOF
fi
# Removing stage file
- rm -f .build/chroot_hosts
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_includes b/scripts/build/chroot_includes
index b023d970e..1508138e4 100755
--- a/scripts/build/chroot_includes
+++ b/scripts/build/chroot_includes
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin copying chroot includes..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/includes.chroot
+STAGE_FILE="includes.chroot"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -45,4 +46,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/includes.chroot
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_install-packages b/scripts/build/chroot_install-packages
index 37ecd0e88..ada5a09c1 100755
--- a/scripts/build/chroot_install-packages
+++ b/scripts/build/chroot_install-packages
@@ -27,10 +27,11 @@ Init_config_data "${@}"
Echo_message "Begin installing packages (${_PASS} pass)..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_install-packages.${_PASS}
+STAGE_FILE="chroot_install-packages.${_PASS}"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -92,4 +93,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/chroot_install-packages.${_PASS}
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_interactive b/scripts/build/chroot_interactive
index a2b6cda55..9a536c61a 100755
--- a/scripts/build/chroot_interactive
+++ b/scripts/build/chroot_interactive
@@ -29,10 +29,11 @@ fi
Echo_message "Begin interactive build..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_interactive
+STAGE_FILE="chroot_interactive"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -53,4 +54,4 @@ case "${LB_INTERACTIVE}" in
esac
# Creating stage file
-Create_stagefile .build/chroot_interactive
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image
index 921580e31..4c39d6f9a 100755
--- a/scripts/build/chroot_linux-image
+++ b/scripts/build/chroot_linux-image
@@ -29,10 +29,11 @@ fi
Echo_message "Begin scheduling kernel image installation..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_linux-image
+STAGE_FILE="chroot_linux-image"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -53,4 +54,4 @@ do
done
# Creating stage file
-Create_stagefile .build/chroot_linux-image
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_package-lists b/scripts/build/chroot_package-lists
index cd1b115a2..7b3fd25ef 100755
--- a/scripts/build/chroot_package-lists
+++ b/scripts/build/chroot_package-lists
@@ -27,10 +27,11 @@ Init_config_data "${@}"
Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_package-lists.${_PASS}
+STAGE_FILE="chroot_package-lists.${_PASS}"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -90,4 +91,4 @@ Remove_package
Save_package_cache chroot
# Creating stage file
-Create_stagefile .build/chroot_package-lists.${_PASS}
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_preseed b/scripts/build/chroot_preseed
index 2de9ea253..bd0466e1e 100755
--- a/scripts/build/chroot_preseed
+++ b/scripts/build/chroot_preseed
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin executing local preseeds..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/chroot_preseed
+STAGE_FILE="chroot_preseed"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -78,4 +79,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/chroot_preseed
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/chroot_proc b/scripts/build/chroot_proc
index 8105e8e34..104a2dcc3 100755
--- a/scripts/build/chroot_proc
+++ b/scripts/build/chroot_proc
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_proc"
case "${1}" in
install)
Echo_message "Begin mounting /proc..."
# Checking stage file
- Check_stagefile .build/chroot_proc
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -41,7 +43,7 @@ case "${1}" in
mount -t proc -o x-gvfs-hide proc-live chroot/proc
# Creating stage file
- Create_stagefile .build/chroot_proc
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -63,7 +65,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_proc
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_resolv b/scripts/build/chroot_resolv
index 174b9d598..d550fea35 100755
--- a/scripts/build/chroot_resolv
+++ b/scripts/build/chroot_resolv
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_resolv"
case "${1}" in
install)
Echo_message "Configuring file /etc/resolv.conf"
# Checking stage file
- Check_stagefile .build/chroot_resolv
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -58,7 +60,7 @@ case "${1}" in
fi
# Creating stage file
- Create_stagefile .build/chroot_resolv
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -89,7 +91,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_resolv
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_selinuxfs b/scripts/build/chroot_selinuxfs
index 570ea7857..77f94e98a 100755
--- a/scripts/build/chroot_selinuxfs
+++ b/scripts/build/chroot_selinuxfs
@@ -22,7 +22,9 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_selinuxfs"
case "${1}" in
install)
@@ -31,7 +33,7 @@ case "${1}" in
Echo_message "Begin mounting /sys/fs/selinux..."
# Checking stage file
- Check_stagefile .build/chroot_selinuxfs
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -43,7 +45,7 @@ case "${1}" in
mount -t selinuxfs -o x-gvfs-hide selinuxfs-live chroot/sys/fs/selinux
# Creating stage file
- Create_stagefile .build/chroot_selinuxfs
+ Create_stagefile "${STAGE_FILE}"
fi
;;
@@ -60,7 +62,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_selinuxfs
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_sysfs b/scripts/build/chroot_sysfs
index 58052a6f2..e4a1d5bb8 100755
--- a/scripts/build/chroot_sysfs
+++ b/scripts/build/chroot_sysfs
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
+
+STAGE_FILE="chroot_sysfs"
case "${1}" in
install)
Echo_message "Begin mounting /sys..."
# Checking stage file
- Check_stagefile .build/chroot_sysfs
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -41,7 +43,7 @@ case "${1}" in
mount -t sysfs -o x-gvfs-hide sysfs-live chroot/sys
# Creating stage file
- Create_stagefile .build/chroot_sysfs
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -57,7 +59,7 @@ case "${1}" in
fi
# Removing stage file
- rm -f .build/chroot_sysfs
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_sysv-rc b/scripts/build/chroot_sysv-rc
index fec3d7a3d..2c4ccd252 100755
--- a/scripts/build/chroot_sysv-rc
+++ b/scripts/build/chroot_sysv-rc
@@ -22,14 +22,16 @@ USAGE="${PROGRAM} {install|remove} [--force]"
Init_config_data "${@}"
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+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 .build/chroot_sysv-rc
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -50,7 +52,7 @@ EOF
chmod 0755 chroot/usr/sbin/policy-rc.d
# Creating stage file
- Create_stagefile .build/chroot_sysv-rc
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -69,7 +71,7 @@ EOF
fi
# Removing stage file
- rm -f .build/chroot_sysv-rc
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/chroot_tmpfs b/scripts/build/chroot_tmpfs
index be613d4a8..9ad643ea2 100755
--- a/scripts/build/chroot_tmpfs
+++ b/scripts/build/chroot_tmpfs
@@ -27,14 +27,16 @@ then
fi
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+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 .build/chroot_tmpfs
+ Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -46,7 +48,7 @@ case "${1}" in
rm -rf chroot/var/lib/dpkg.tmp
# Creating stage file
- Create_stagefile .build/chroot_tmpfs
+ Create_stagefile "${STAGE_FILE}"
;;
remove)
@@ -62,7 +64,7 @@ case "${1}" in
mv chroot/var/lib/dpkg.tmp chroot/var/lib/dpkg
# Removing stage file
- rm -f .build/chroot_tmpfs
+ Remove_stagefile "${STAGE_FILE}"
;;
*)
diff --git a/scripts/build/config b/scripts/build/config
index 2b9ff701c..a344c59e6 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1513,4 +1513,4 @@ Type: ${LIVE_IMAGE_TYPE}
EOF
# Creating stage file
-Create_stagefile .build/config
+Create_stagefile config
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index 5eb935fe6..12c05f31e 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -49,10 +49,11 @@ esac
Echo_message "Begin installing debian-installer..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/installer_debian-installer
+STAGE_FILE="installer_debian-installer"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -880,4 +881,4 @@ Save_package_cache binary
Remove_package
# Creating stage file
-Create_stagefile .build/installer_debian-installer
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/installer_preseed b/scripts/build/installer_preseed
index 90a0d91b2..9aacd9286 100755
--- a/scripts/build/installer_preseed
+++ b/scripts/build/installer_preseed
@@ -31,7 +31,8 @@ esac
Echo_message "Begin including local preseeds..."
# Checking stage file
-Check_stagefile .build/installer_preseed
+STAGE_FILE="installer_preseed"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -62,4 +63,4 @@ then
fi
# Creating stage file
-Create_stagefile .build/installer_preseed
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_checksums b/scripts/build/source_checksums
index 46e304299..4d16adbcf 100755
--- a/scripts/build/source_checksums
+++ b/scripts/build/source_checksums
@@ -27,10 +27,11 @@ then
fi
# Requiring stage file
-Require_stagefile .build/config .build/source_debian
+Require_stagefile config source_debian
# Checking stage file
-Check_stagefile .build/source_checksums
+STAGE_FILE="source_checksums"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -92,4 +93,4 @@ EOF
done
# Creating stage file
-Create_stagefile .build/source_checksums
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_debian b/scripts/build/source_debian
index c39ecb240..be3894c16 100755
--- a/scripts/build/source_debian
+++ b/scripts/build/source_debian
@@ -29,10 +29,11 @@ fi
Echo_message "Begin downloading sources..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/source_debian
+STAGE_FILE="source_debian"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -211,5 +212,5 @@ then
fi
# Creating stage file
-Create_stagefile .build/source_debian
-Create_stagefile .build/source
+Create_stagefile "${STAGE_FILE}"
+Create_stagefile source
diff --git a/scripts/build/source_disk b/scripts/build/source_disk
index ace6d4ebf..77f8afade 100755
--- a/scripts/build/source_disk
+++ b/scripts/build/source_disk
@@ -33,10 +33,11 @@ esac
Echo_message "Begin installing disk information..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/source_disk
+STAGE_FILE="source_disk"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -118,4 +119,4 @@ case "${LB_DEBIAN_INSTALLER}" in
esac
# Creating stage file
-Create_stagefile .build/source_disk
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_hdd b/scripts/build/source_hdd
index 962753660..f56a15304 100755
--- a/scripts/build/source_hdd
+++ b/scripts/build/source_hdd
@@ -34,10 +34,11 @@ fi
Echo_message "Begin building source hdd image..."
# Requiring stage file
-Require_stagefile .build/config .build/source_debian
+Require_stagefile config source_debian
# Checking stage file
-Check_stagefile .build/source_hdd
+STAGE_FILE="source_hdd"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -148,4 +149,4 @@ fi
Remove_package
# Creating stage file
-Create_stagefile .build/source_hdd
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_hooks b/scripts/build/source_hooks
index 17260d073..eec474357 100755
--- a/scripts/build/source_hooks
+++ b/scripts/build/source_hooks
@@ -24,10 +24,11 @@ Init_config_data "${@}"
Echo_message "Begin executing hooks..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/source_hooks
+STAGE_FILE="source_hooks"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -72,4 +73,4 @@ do
done
# Creating stage file
-Create_stagefile .build/source_hooks
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_iso b/scripts/build/source_iso
index a737f3e7b..cd861fc98 100755
--- a/scripts/build/source_iso
+++ b/scripts/build/source_iso
@@ -38,10 +38,11 @@ esac
Echo_message "Begin building source iso image..."
# Requiring stage file
-Require_stagefile .build/config .build/source_debian
+Require_stagefile config source_debian
# Checking stage file
-Check_stagefile .build/source_iso
+STAGE_FILE="source_iso"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -114,4 +115,4 @@ rm -f chroot/source.sh
Remove_package
# Creating stage file
-Create_stagefile .build/source_iso
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_live b/scripts/build/source_live
index 66b2e9beb..e03a37677 100755
--- a/scripts/build/source_live
+++ b/scripts/build/source_live
@@ -29,10 +29,11 @@ fi
Echo_message "Begin copying live-build configuration..."
# Requiring stage file
-Require_stagefile .build/config .build/bootstrap
+Require_stagefile config bootstrap
# Checking stage file
-Check_stagefile .build/source_live
+STAGE_FILE="source_live"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -61,4 +62,4 @@ packages used in the "live" disc).
EOF
# Creating stage file
-Create_stagefile .build/source_live
+Create_stagefile "${STAGE_FILE}"
diff --git a/scripts/build/source_tar b/scripts/build/source_tar
index 23581488a..cedea3bd1 100755
--- a/scripts/build/source_tar
+++ b/scripts/build/source_tar
@@ -35,10 +35,11 @@ Echo_message "Begin building source tarball..."
Echo_message "This may take a while."
# Requiring stage file
-Require_stagefile .build/config .build/source_debian
+Require_stagefile config source_debian
# Checking stage file
-Check_stagefile .build/source_tar
+STAGE_FILE="source_tar"
+Check_stagefile "${STAGE_FILE}"
# Acquire lock file
Acquire_lockfile
@@ -76,4 +77,4 @@ case "${LB_COMPRESSION}" in
esac
# Creating stage file
-Create_stagefile .build/source_tar
+Create_stagefile "${STAGE_FILE}"