stagefiles: further robustify with auto filenames

as suggested by Raphaël

rather than have fixed stagefile filename strings at all in the scripts,
use `$(basename $0)` to use the name of the script (which is the same for
almost all cases anyway, and the stage files are supposed to be almost
exclusively unique per-script). we can thus simplify things by determining
the filename for most use cases within the functions themselves.

this does change the file used by a couple of scripts, affecting backwards
compatibility of executing live-build upon an existing partially or fully
completed build:
 - binary_grub-pc used "binary_grub"
 - chroot_includes used "includes.chroot"

care had to be taken for the following cases:
 - there are some cases like bootstrap_cache, source_debian and
   bootstrap_debootstrap which are dealing with more than one file, and/or
   otherwise a filename that is not specific to the script itself exactly,
   or should not be based upon its name.
 - some cases like chroot_cache, bootstrap_cache and
   chroot_install-packages need to append something to the end of the name
   depending upon which pass/action mode the script is being executed with.
 - furthermore in the bootstrap_cache case one of the filenames is used
   within the bootstrap_debootstrap and thus needs very careful handling
   to be certain that a change in filename of bootstrap_cache does not
   break bootstrap_debootstrap.

Gbp-Dch: Short
This commit is contained in:
Lyndon Brown 2020-03-13 17:11:53 +00:00
parent 04d9ee0211
commit fe9195b59c
61 changed files with 169 additions and 210 deletions

View File

@ -9,9 +9,21 @@
## under certain conditions; see COPYING for details.
# Get the default filename for a script's stagefile (the name of the script
# file itself). A suffix can be appended via providing as a param.
Stagefile_name ()
{
local SUFFIX="${1}"
local FILENAME
FILENAME="$(basename $0)"
echo ${FILENAME}${SUFFIX:+.$SUFFIX}
}
Check_stagefile ()
{
FILE=".build/${1}"
local FILE
local NAME
FILE=".build/${1:-$(Stagefile_name)}"
NAME="$(basename ${FILE})"
# Checking stage file
@ -32,7 +44,9 @@ Check_stagefile ()
Create_stagefile ()
{
FILE=".build/${1}"
local FILE
local DIRECTORY
FILE=".build/${1:-$(Stagefile_name)}"
DIRECTORY="$(dirname ${FILE})"
# Creating stage directory
@ -44,7 +58,9 @@ Create_stagefile ()
Remove_stagefile ()
{
rm -f ".build/${1}"
local FILE
FILE=".build/${1:-$(Stagefile_name)}"
rm -f "${FILE}"
}
Require_stagefile ()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -29,13 +29,16 @@ then
exit 0
fi
# Note, this (plus the applicable extension added below) must match that used in `bootstrap_debootstrap`
STAGE_FILE="bootstrap_cache"
_ACTION="${1}"
shift
case "${1}" in
# 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.${_ACTION}"
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

View File

@ -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"

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -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
;;
*)

View File

@ -1513,4 +1513,4 @@ Type: ${LIVE_IMAGE_TYPE}
EOF
# Creating stage file
Create_stagefile config
Create_stagefile

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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