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:
jnqnfe 2015-02-05 03:30:47 +00:00 committed by Lyndon Brown
parent 346e3e1c36
commit b27927724a
61 changed files with 172 additions and 397 deletions

View File

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

View 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View 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)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ then
exit 1
fi
rm -f .lock
Remove_lockfile
if [ -z "${1}" ]
then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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