tidy script init (2/4) - build stage scripts

Partial fix for #952919

Gbp-Dch: Short
This commit is contained in:
jnqnfe 2015-02-05 03:30:47 +00:00 committed by Luca Boccassi
parent b49abcc1a8
commit 061d7cb340
7 changed files with 37 additions and 50 deletions

View File

@ -56,8 +56,8 @@ Exit ()
return ${VALUE} return ${VALUE}
} }
Setup_cleanup () Setup_clean_exit ()
{ {
Echo_message "Setting up cleanup function" Echo_message "Setting up clean exit handler"
trap 'Exit' EXIT HUP INT QUIT TERM trap 'Exit' EXIT HUP INT QUIT TERM
} }

View File

@ -13,6 +13,15 @@ Common_config_files ()
echo "config/all config/common config/bootstrap config/chroot config/binary config/source" echo "config/all config/common config/bootstrap config/chroot config/binary config/source"
} }
Auto_build_config ()
{
# Automatically build config
if [ -x auto/config ] && [ ! -e .build/config ]; then
Echo_message "Automatically populating config tree."
lb config
fi
}
Init_config_data () Init_config_data ()
{ {
Arguments "${@}" Arguments "${@}"

View File

@ -13,23 +13,19 @@ set -e
# Including common functions # Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Automatically populating config tree
if [ -x auto/config ] && [ ! -e .build/config ]
then
Echo_message "Automatically populating config tree."
lb config
fi
# Setting static variables # Setting static variables
DESCRIPTION="Build binary images" DESCRIPTION="Build binary images"
HELP="" HELP=""
USAGE="${PROGRAM} [--force]" USAGE="${PROGRAM} [--force]"
# Automatically populating config tree
Auto_build_config
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
# Setup cleanup function # Setting up cleanup function
Setup_cleanup Setup_clean_exit
# Preparing root filesystem # Preparing root filesystem
lb binary_chroot ${@} lb binary_chroot ${@}

View File

@ -13,23 +13,19 @@ set -e
# Including common functions # Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Automatically populating config tree
if [ -x auto/config ] && [ ! -e .build/config ]
then
Echo_message "Automatically populating config tree."
lb config
fi
# Setting static variables # Setting static variables
DESCRIPTION="Bootstrap a Debian system" DESCRIPTION="Bootstrap a Debian system"
HELP="" HELP=""
USAGE="${PROGRAM} [--force]" USAGE="${PROGRAM} [--force]"
# Automatically populating config tree
Auto_build_config
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
# Setup cleanup function # Setting up cleanup function
Setup_cleanup Setup_clean_exit
# Bootstrapping system # Bootstrapping system
lb bootstrap_cache restore ${@} lb bootstrap_cache restore ${@}

View File

@ -13,23 +13,19 @@ set -e
# Including common functions # Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Automatically populating config tree
if [ -x auto/config ] && [ ! -e .build/config ]
then
Echo_message "Automatically populating config tree."
lb config
fi
# Setting static variables # Setting static variables
DESCRIPTION="Customize the Debian system" DESCRIPTION="Customize the Debian system"
HELP="" HELP=""
USAGE="${PROGRAM} [--force]" USAGE="${PROGRAM} [--force]"
# Automatically populating config tree
Auto_build_config
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
# Setup cleanup function # Setting up cleanup function
Setup_cleanup Setup_clean_exit
# Configuring chroot # Configuring chroot
lb chroot_cache restore ${@} lb chroot_cache restore ${@}

View File

@ -13,23 +13,19 @@ set -e
# Including common functions # Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Automatically populating config tree
if [ -x auto/config ] && [ ! -e .build/config ]
then
Echo_message "Automatically populating config tree."
lb config
fi
# Setting static variables # Setting static variables
DESCRIPTION="Preparing installer images" DESCRIPTION="Preparing installer images"
HELP="" HELP=""
USAGE="${PROGRAM} [--force]" USAGE="${PROGRAM} [--force]"
# Automatically populating config tree
Auto_build_config
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
# Setup cleanup function # Setting up cleanup function
Setup_cleanup Setup_clean_exit
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
then then

View File

@ -13,18 +13,14 @@ set -e
# Including common functions # Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Automatically populating config tree
if [ -x auto/config ] && [ ! -e .build/config ]
then
Echo_message "Automatically populating config tree."
lb config
fi
# Setting static variables # Setting static variables
DESCRIPTION="Build source images" DESCRIPTION="Build source images"
HELP="" HELP=""
USAGE="${PROGRAM} [--force]" USAGE="${PROGRAM} [--force]"
# Automatically populating config tree
Auto_build_config
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
@ -33,12 +29,10 @@ then
exit 0 exit 0
fi fi
#Require_stagefile # Setting up cleanup function
Setup_clean_exit
# Setup cleanup function # Configuring chroot (enabling networking)
Setup_cleanup
# Enabling network in chroot
lb chroot_hosts install ${@} lb chroot_hosts install ${@}
lb chroot_resolv install ${@} lb chroot_resolv install ${@}
lb chroot_hostname install ${@} lb chroot_hostname install ${@}