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
This commit is contained in:
Lyndon Brown 2020-03-12 01:21:39 +00:00
parent bea349c822
commit 04d9ee0211
62 changed files with 287 additions and 200 deletions

View File

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

View File

@ -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 ${@}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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