locks: tidy lock acquisition
Combine the check+create done in each script. (The original functions are still callable as before, but a new combined `Aquire_lockfile` function can be called instead, as now used). Note, a further simplification could be done in removing the passing of the lock filename in as a parameter since every use of the functions is with ".lock". The lock functions already have a fallback to ".build/lock" though. Checking the history, the fallback used to be for a system wide lock, which was then replaced with this config-tree specific one. As long as that is not used implicitly by 3rd-party hooks then surely we are free to change the fallback to ".lock" and further remove passing in a name as a param...? history:db5d2b0dcd
0aa8289a37
Gbp-Dch: Short Closes: #952918
This commit is contained in:
parent
346e3e1c36
commit
b27927724a
|
@ -9,40 +9,38 @@
|
|||
## under certain conditions; see COPYING for details.
|
||||
|
||||
|
||||
Acquire_lockfile ()
|
||||
{
|
||||
local FILE="${1:-.lock}"
|
||||
Check_lockfile "${FILE}"
|
||||
Create_lockfile "${FILE}"
|
||||
}
|
||||
|
||||
Check_lockfile ()
|
||||
{
|
||||
FILE="${1}"
|
||||
local FILE="${1}"
|
||||
|
||||
if [ -z "${FILE}" ]
|
||||
then
|
||||
FILE=".build/lock"
|
||||
fi
|
||||
|
||||
# Checking lock file
|
||||
if [ -f "${FILE}" ]
|
||||
then
|
||||
Echo_error "${PROGRAM} locked"
|
||||
if [ -f "${FILE}" ]; then
|
||||
Echo_error "${PROGRAM} already locked"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Create_lockfile ()
|
||||
{
|
||||
FILE="${1}"
|
||||
local FILE="${1}"
|
||||
|
||||
if [ -z "${FILE}" ]
|
||||
then
|
||||
FILE=".build/lock"
|
||||
fi
|
||||
|
||||
DIRECTORY="$(dirname ${FILE})"
|
||||
|
||||
# Creating lock directory
|
||||
mkdir -p "${DIRECTORY}"
|
||||
|
||||
# Creating lock trap
|
||||
# Create lock trap
|
||||
# This automatically removes the lock file in certain conditions
|
||||
trap 'ret=${?}; '"rm -f \"${FILE}\";"' exit ${ret}' EXIT HUP INT QUIT TERM
|
||||
|
||||
# Creating lock file
|
||||
touch "${FILE}"
|
||||
}
|
||||
|
||||
Remove_lockfile ()
|
||||
{
|
||||
local FILE="${1:-.lock}"
|
||||
|
||||
rm -f "${FILE}"
|
||||
}
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_checksums
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
for CHECKSUM in ${LB_CHECKSUMS}
|
||||
do
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_chroot
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Normally, virtual filesystems are not mounted here, but people tend to be lazy
|
||||
if [ -f chroot/proc/version ]
|
||||
|
|
|
@ -37,11 +37,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_disk
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
mkdir -p binary/.disk
|
||||
|
||||
|
|
|
@ -31,11 +31,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_grub-efi
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check architecture
|
||||
Check_architectures amd64 i386 arm64
|
||||
|
|
|
@ -31,11 +31,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_grub-legacy
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check architecture
|
||||
Check_architectures amd64 i386
|
||||
|
|
|
@ -31,11 +31,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_grub
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check architecture
|
||||
Check_architectures amd64 i386
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap .build/chroot_proc
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_hdd
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
case "${LB_BINARY_FILESYSTEM}" in
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_hooks
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
## Processing distribution hooks
|
||||
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_includes
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if Find_files config/includes.binary/
|
||||
then
|
||||
|
|
|
@ -43,11 +43,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_iso
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package chroot /usr/bin/xorriso xorriso
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_linux-image
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_INITRAMFS}" in
|
||||
live-boot)
|
||||
|
|
|
@ -34,12 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_loadlin
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_ARCHITECTURES}" in
|
||||
amd64|i386)
|
||||
|
|
|
@ -33,11 +33,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_loopback_cfg
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check architecture
|
||||
Check_architectures amd64 i386
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_manifest
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_INITRAMFS}" in
|
||||
live-boot)
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_memtest
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ "${LB_ARCHITECTURES}" != "amd64" ] && [ "${LB_ARCHITECTURES}" != "i386" ]
|
||||
then
|
||||
|
|
|
@ -39,11 +39,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_netboot
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove old binary
|
||||
rm -f ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar.gz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar.bz2 ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar.xz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar.xz
|
||||
|
|
|
@ -47,11 +47,8 @@ Require_stagefile .build/config .build/binary_iso
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_onie
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
Check_package host /bin/cpio cpio
|
||||
Check_package host /usr/bin/file file
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_package-lists
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_MODE}" in
|
||||
progress-linux)
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap .build/binary_chroot
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_rootfs
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_ARCHITECTURES}" in
|
||||
amd64|i386)
|
||||
|
@ -135,7 +132,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
|
||||
if [ -e chroot/chroot.cache ]
|
||||
then
|
||||
rm -f .lock
|
||||
Remove_lockfile
|
||||
mv chroot/chroot chroot.tmp
|
||||
|
||||
lb chroot_archives binary remove ${@}
|
||||
|
@ -223,7 +220,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
|
||||
if [ -e chroot/chroot.cache ]
|
||||
then
|
||||
rm -f .lock
|
||||
Remove_lockfile
|
||||
mv chroot/chroot chroot.tmp
|
||||
|
||||
lb chroot_archives binary remove ${@}
|
||||
|
@ -358,7 +355,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
|
||||
if [ -e chroot/chroot.cache ]
|
||||
then
|
||||
rm -f .lock
|
||||
Remove_lockfile
|
||||
mv chroot/chroot chroot.tmp
|
||||
|
||||
lb chroot_archives binary remove ${@}
|
||||
|
|
|
@ -31,11 +31,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_syslinux
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check architecture
|
||||
Check_architectures amd64 i386
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_tar
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove old binary
|
||||
rm -f ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.tar.bz2 ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.tar.gz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.tar.lz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.tar
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_win32-loader
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_MODE}" in
|
||||
progress-linux)
|
||||
|
|
|
@ -39,11 +39,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/binary_zsync
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package chroot /usr/bin/zsyncmake zsync
|
||||
|
|
|
@ -36,11 +36,8 @@ Echo_message "Configuring file /etc/apt/sources.list"
|
|||
# Checking stage file
|
||||
Check_stagefile .build/bootstrap_archives
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Restoring cache
|
||||
Restore_package_cache chroot
|
||||
|
|
|
@ -38,11 +38,8 @@ case "${1}" in
|
|||
then
|
||||
Echo_message "Restoring bootstrap stage from cache..."
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Removing old chroot
|
||||
rm -rf chroot
|
||||
|
@ -64,11 +61,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/bootstrap_cache.save
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
rm -rf cache/bootstrap
|
||||
|
||||
|
|
|
@ -40,11 +40,8 @@ Check_package chroot bin/debootstrap debootstrap
|
|||
Check_stagefile .build/bootstrap
|
||||
Check_stagefile .build/bootstrap_cache.restore
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Creating chroot directory
|
||||
mkdir -p chroot
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_apt
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
mkdir -p chroot/etc/apt/apt.conf.d
|
||||
|
||||
|
@ -214,11 +211,8 @@ EOF
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/apt/apt.conf"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Deconfiguring aptitude ftp proxy
|
||||
rm -f chroot/etc/apt/apt.conf.d/00ftp-proxy
|
||||
|
|
|
@ -38,11 +38,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_archives
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Restoring cache
|
||||
Restore_package_cache chroot
|
||||
|
@ -321,11 +318,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/apt/sources.list"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Restore top-level sources
|
||||
if [ -e chroot/etc/apt/sources.list.d/zz-sources.list ]
|
||||
|
|
|
@ -35,11 +35,8 @@ case "${1}" in
|
|||
|
||||
if [ -d cache/chroot ]
|
||||
then
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Removing old chroot
|
||||
rm -rf chroot
|
||||
|
@ -60,11 +57,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_cache.save
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
rm -rf cache/chroot
|
||||
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_debianchroot
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -f chroot/etc/debian_chroot ]
|
||||
then
|
||||
|
@ -53,11 +50,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/debian_chroot"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -f chroot/etc/debian_chroot.orig ]
|
||||
then
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_devpts
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Creating mountpoint
|
||||
mkdir -p chroot/dev/pts
|
||||
|
@ -50,11 +47,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Begin unmounting /dev/pts..."
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Unmounting /dev/pts
|
||||
if grep -qs "$(pwd)/chroot/dev/pts" /proc/mounts || Find_files chroot/dev/pts/*
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_dpkg
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Create custom start-stop-daemon program
|
||||
Chroot chroot dpkg-divert --rename --quiet --add /sbin/start-stop-daemon
|
||||
|
@ -65,11 +62,8 @@ EOF
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /sbin/start-stop-daemon"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Manual hacks for special packages
|
||||
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_firmware
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package host /usr/bin/wget wget
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_hacks
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LIVE_IMAGE_TYPE}" in
|
||||
netboot)
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_hooks
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
## Processing distribution hooks
|
||||
|
||||
|
|
|
@ -29,11 +29,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_hostname
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Create hostname file
|
||||
Echo_message "Configuring file /etc/hostname"
|
||||
|
@ -60,11 +57,8 @@ EOF
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/hostname"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Copying hostname from includes, if existing
|
||||
if [ -e config/includes.chroot/etc/hostname ]
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_hosts
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -f chroot/etc/hosts ]
|
||||
then
|
||||
|
@ -64,11 +61,8 @@ EOF
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/hosts"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -e config/includes.chroot/etc/hosts ]
|
||||
then
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/includes.chroot
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if Find_files config/includes.chroot/
|
||||
then
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_install-packages.${PASS}
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Check for packages specified with foreign architecture
|
||||
_FOREIGN_ARCHITECTURES_FILE="chroot/root/packages.foreign-architectures"
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_interactive
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
case "${LB_INTERACTIVE}" in
|
||||
true|shell)
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_linux-image
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Diverting update-initramfs
|
||||
#case "${LB_INITRAMFS}" in
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_package-lists.${_PASS}
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Handling local package lists
|
||||
if ! ( ls config/package-lists/*.list > /dev/null 2>&1 || \
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_preseed
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if ls config/preseed/*.cfg > /dev/null 2>&1 || \
|
||||
ls config/preseed/*.cfg.chroot > /dev/null 2>&1 || \
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_proc
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Creating mountpoint
|
||||
mkdir -p chroot/proc
|
||||
|
@ -50,11 +47,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Begin unmounting /proc..."
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Workaround binfmt-support /proc locking
|
||||
if [ -e chroot/proc/sys/fs/binfmt_misc/status ]
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_resolv
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -e chroot/etc/resolv.conf ]
|
||||
then
|
||||
|
@ -67,11 +64,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /etc/resolv.conf"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -e config/includes.chroot/etc/resolv.conf ]
|
||||
then
|
||||
|
|
|
@ -33,11 +33,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_selinuxfs
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Create mountpoint
|
||||
mkdir -p chroot/sys/fs/selinux
|
||||
|
@ -53,11 +50,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Begin unmounting /sys/fs/selinux..."
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Unmounting /sys/fs/selinux
|
||||
if [ -e chroot/sys/fs/selinux/enforce ]
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_sysfs
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Create mountpoint
|
||||
mkdir -p chroot/sys
|
||||
|
@ -50,11 +47,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Begin unmounting /sys..."
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Unmounting /sys
|
||||
if [ -e chroot/sys/class ]
|
||||
|
|
|
@ -31,11 +31,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_sysv-rc
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if [ -e chroot/usr/sbin/policy-rc.d ]
|
||||
then
|
||||
|
@ -59,11 +56,8 @@ EOF
|
|||
remove)
|
||||
Echo_message "Deconfiguring file /usr/sbin/policy-rc.d"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove custom policy-rc.d file
|
||||
rm -f chroot/usr/sbin/policy-rc.d
|
||||
|
|
|
@ -36,11 +36,8 @@ case "${1}" in
|
|||
# Checking stage file
|
||||
Check_stagefile .build/chroot_tmpfs
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
mv chroot/var/lib/dpkg chroot/var/lib/dpkg.tmp
|
||||
mkdir chroot/var/lib/dpkg
|
||||
|
@ -55,11 +52,8 @@ case "${1}" in
|
|||
remove)
|
||||
Echo_message "Deconfiguring tmpfs for /var/lib/dpkg"
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
mkdir -p chroot/var/lib/dpkg.tmp
|
||||
mv chroot/var/lib/dpkg/* chroot/var/lib/dpkg.tmp
|
||||
|
|
|
@ -37,7 +37,7 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
rm -f .lock
|
||||
Remove_lockfile
|
||||
|
||||
if [ -z "${1}" ]
|
||||
then
|
||||
|
|
|
@ -54,11 +54,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/installer_debian-installer
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package host /usr/bin/wget wget
|
||||
|
|
|
@ -33,11 +33,8 @@ Echo_message "Begin including local preseeds..."
|
|||
# Checking stage file
|
||||
Check_stagefile .build/installer_preseed
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
if ls config/preseed/*.cfg > /dev/null 2>&1 || \
|
||||
ls config/preseed/*.cfg.installer > /dev/null 2>&1 || \
|
||||
|
|
|
@ -32,11 +32,8 @@ Require_stagefile .build/config .build/source_debian
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_checksums
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
for DIRECTORY in source/debian source/live
|
||||
do
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_debian
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove old sources
|
||||
if [ -d source/debian ]
|
||||
|
|
|
@ -38,11 +38,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_disk
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
mkdir -p source/.disk
|
||||
|
||||
|
|
|
@ -39,11 +39,8 @@ Require_stagefile .build/config .build/source_debian
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_hdd
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package chroot /sbin/mkdosfs dosfstools
|
||||
|
|
|
@ -29,11 +29,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_hooks
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
## Processing distribution hooks
|
||||
|
||||
|
|
|
@ -43,11 +43,8 @@ Require_stagefile .build/config .build/source_debian
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_iso
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Checking depends
|
||||
Check_package chroot /usr/bin/xorriso xorriso
|
||||
|
|
|
@ -34,11 +34,8 @@ Require_stagefile .build/config .build/bootstrap
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_live
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove old sources
|
||||
if [ -d source/live ]
|
||||
|
|
|
@ -40,11 +40,8 @@ Require_stagefile .build/config .build/source_debian
|
|||
# Checking stage file
|
||||
Check_stagefile .build/source_tar
|
||||
|
||||
# Checking lock file
|
||||
Check_lockfile .lock
|
||||
|
||||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
# Aquire lock file
|
||||
Acquire_lockfile
|
||||
|
||||
# Remove old source
|
||||
rm -f ${LIVE_IMAGE_NAME}-source.debian.tar.bz2 ${LIVE_IMAGE_NAME}-source.debian.tar.gz ${LIVE_IMAGE_NAME}-source.debian.tar.lz ${LIVE_IMAGE_NAME}-source.debian.tar
|
||||
|
|
Loading…
Reference in New Issue