summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorjnqnfe <jnqnfe@gmail.com>2015-02-05 03:30:47 +0000
committerLuca Boccassi <bluca@debian.org>2020-03-10 12:39:37 +0000
commitb49abcc1a8002c52b45c3e3da6723097f99c26e6 (patch)
tree46f650bb927ba9a8a705d01aa73c090c98f47c12 /scripts/build
parented2d70bde10e8ff02e7409c125a6c70da8d6d9ba (diff)
downloadvyos-live-build-b49abcc1a8002c52b45c3e3da6723097f99c26e6.tar.gz
vyos-live-build-b49abcc1a8002c52b45c3e3da6723097f99c26e6.zip
tidy script init (1/4) - arg and config processing
Partial fix for #952919 Gbp-Dch: Short
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/binary7
-rwxr-xr-xscripts/build/binary_checksums7
-rwxr-xr-xscripts/build/binary_chroot7
-rwxr-xr-xscripts/build/binary_disk7
-rwxr-xr-xscripts/build/binary_grub-efi7
-rwxr-xr-xscripts/build/binary_grub-legacy7
-rwxr-xr-xscripts/build/binary_grub-pc7
-rwxr-xr-xscripts/build/binary_hdd7
-rwxr-xr-xscripts/build/binary_hooks7
-rwxr-xr-xscripts/build/binary_includes7
-rwxr-xr-xscripts/build/binary_iso7
-rwxr-xr-xscripts/build/binary_linux-image7
-rwxr-xr-xscripts/build/binary_loadlin7
-rwxr-xr-xscripts/build/binary_loopback_cfg7
-rwxr-xr-xscripts/build/binary_manifest7
-rwxr-xr-xscripts/build/binary_memtest7
-rwxr-xr-xscripts/build/binary_netboot7
-rwxr-xr-xscripts/build/binary_onie7
-rwxr-xr-xscripts/build/binary_package-lists7
-rwxr-xr-xscripts/build/binary_rootfs7
-rwxr-xr-xscripts/build/binary_syslinux7
-rwxr-xr-xscripts/build/binary_tar7
-rwxr-xr-xscripts/build/binary_win32-loader7
-rwxr-xr-xscripts/build/binary_zsync7
-rwxr-xr-xscripts/build/bootstrap7
-rwxr-xr-xscripts/build/bootstrap_archives7
-rwxr-xr-xscripts/build/bootstrap_cache7
-rwxr-xr-xscripts/build/bootstrap_debootstrap7
-rwxr-xr-xscripts/build/build7
-rwxr-xr-xscripts/build/chroot7
-rwxr-xr-xscripts/build/chroot_apt7
-rwxr-xr-xscripts/build/chroot_archives7
-rwxr-xr-xscripts/build/chroot_cache7
-rwxr-xr-xscripts/build/chroot_debianchroot7
-rwxr-xr-xscripts/build/chroot_devpts7
-rwxr-xr-xscripts/build/chroot_dpkg7
-rwxr-xr-xscripts/build/chroot_firmware7
-rwxr-xr-xscripts/build/chroot_hacks7
-rwxr-xr-xscripts/build/chroot_hooks7
-rwxr-xr-xscripts/build/chroot_hostname7
-rwxr-xr-xscripts/build/chroot_hosts7
-rwxr-xr-xscripts/build/chroot_includes7
-rwxr-xr-xscripts/build/chroot_install-packages7
-rwxr-xr-xscripts/build/chroot_interactive7
-rwxr-xr-xscripts/build/chroot_linux-image7
-rwxr-xr-xscripts/build/chroot_package-lists7
-rwxr-xr-xscripts/build/chroot_preseed7
-rwxr-xr-xscripts/build/chroot_proc7
-rwxr-xr-xscripts/build/chroot_resolv7
-rwxr-xr-xscripts/build/chroot_selinuxfs7
-rwxr-xr-xscripts/build/chroot_sysfs7
-rwxr-xr-xscripts/build/chroot_sysv-rc7
-rwxr-xr-xscripts/build/chroot_tmpfs7
-rwxr-xr-xscripts/build/clean2
-rwxr-xr-xscripts/build/config4
-rwxr-xr-xscripts/build/installer7
-rwxr-xr-xscripts/build/installer_debian-installer7
-rwxr-xr-xscripts/build/installer_preseed8
-rwxr-xr-xscripts/build/source7
-rwxr-xr-xscripts/build/source_checksums7
-rwxr-xr-xscripts/build/source_debian7
-rwxr-xr-xscripts/build/source_disk7
-rwxr-xr-xscripts/build/source_hdd7
-rwxr-xr-xscripts/build/source_hooks7
-rwxr-xr-xscripts/build/source_iso7
-rwxr-xr-xscripts/build/source_live7
-rwxr-xr-xscripts/build/source_tar7
67 files changed, 133 insertions, 329 deletions
diff --git a/scripts/build/binary b/scripts/build/binary
index 9f36dfedc..24acb0500 100755
--- a/scripts/build/binary
+++ b/scripts/build/binary
@@ -25,11 +25,8 @@ DESCRIPTION="Build binary images"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Setup cleanup function
Setup_cleanup
diff --git a/scripts/build/binary_checksums b/scripts/build/binary_checksums
index 368365734..002be0487 100755
--- a/scripts/build/binary_checksums
+++ b/scripts/build/binary_checksums
@@ -18,11 +18,8 @@ DESCRIPTION="Create binary checksums"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_CHECKSUMS}" = "none" ]
then
diff --git a/scripts/build/binary_chroot b/scripts/build/binary_chroot
index 0b689894e..bb968ee60 100755
--- a/scripts/build/binary_chroot
+++ b/scripts/build/binary_chroot
@@ -18,11 +18,8 @@ DESCRIPTION="Copy chroot into chroot"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin copying chroot..."
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk
index d22279d8b..e26a0d787 100755
--- a/scripts/build/binary_disk
+++ b/scripts/build/binary_disk
@@ -18,11 +18,8 @@ DESCRIPTION="Install disk information into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
case "${LIVE_IMAGE_TYPE}" in
iso*|hdd*)
diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi
index d36b4abb4..50a033f80 100755
--- a/scripts/build/binary_grub-efi
+++ b/scripts/build/binary_grub-efi
@@ -18,11 +18,8 @@ DESCRIPTION="Prepares and installs Grub based EFI support into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Check_Any_Bootloader_Role "grub-efi"
diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy
index fd08a7f84..a6c5fa733 100755
--- a/scripts/build/binary_grub-legacy
+++ b/scripts/build/binary_grub-legacy
@@ -18,11 +18,8 @@ DESCRIPTION="Installs grub-legacy into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Check_First_Bootloader_Role "grub-legacy"
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index bea8fae65..948530679 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -18,11 +18,8 @@ DESCRIPTION="Installs grub-pc into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Check_Any_Bootloader_Role "grub-pc"
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index e75019ff3..c9c508518 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -18,11 +18,8 @@ DESCRIPTION="Build binary image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if ! In_list hdd "${LIVE_IMAGE_TYPE}"
then
diff --git a/scripts/build/binary_hooks b/scripts/build/binary_hooks
index e421bfa9d..c5c6a3ce2 100755
--- a/scripts/build/binary_hooks
+++ b/scripts/build/binary_hooks
@@ -18,11 +18,8 @@ DESCRIPTION="Execute hooks in binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin executing hooks..."
diff --git a/scripts/build/binary_includes b/scripts/build/binary_includes
index 70bd596af..091105fbc 100755
--- a/scripts/build/binary_includes
+++ b/scripts/build/binary_includes
@@ -18,11 +18,8 @@ DESCRIPTION="Copy files into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin copying binary includes..."
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index c6aec8dfb..c634c3d19 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -18,11 +18,8 @@ DESCRIPTION="Build iso binary image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
case "${LIVE_IMAGE_TYPE}" in
iso)
diff --git a/scripts/build/binary_linux-image b/scripts/build/binary_linux-image
index 9648ac6fd..0da698ade 100755
--- a/scripts/build/binary_linux-image
+++ b/scripts/build/binary_linux-image
@@ -18,11 +18,8 @@ DESCRIPTION="Install linux-image into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_LINUX_PACKAGES}" = "none" ]
then
diff --git a/scripts/build/binary_loadlin b/scripts/build/binary_loadlin
index 4c205f145..a14ad1eda 100755
--- a/scripts/build/binary_loadlin
+++ b/scripts/build/binary_loadlin
@@ -18,11 +18,8 @@ DESCRIPTION="Copy loadlin into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_LOADLIN}" != "true" ] || [ "${LB_BINARY_IMAGES}" = "netboot" ]
then
diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg
index 9780a916b..6adc88bb3 100755
--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_loopback_cfg
@@ -18,11 +18,8 @@ DESCRIPTION="Installs loopback.cfg into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# We avoid checking if we need to be running this bootloader
# on purpose. The reason: You will always want to have
diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest
index eeb0721c7..b11cee2dc 100755
--- a/scripts/build/binary_manifest
+++ b/scripts/build/binary_manifest
@@ -18,11 +18,8 @@ DESCRIPTION="Create manifest"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_CHROOT_FILESYSTEM}" = "none" ]
then
diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest
index 40628a9c5..539819b3a 100755
--- a/scripts/build/binary_memtest
+++ b/scripts/build/binary_memtest
@@ -18,11 +18,8 @@ DESCRIPTION="Installs a memtest into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_MEMTEST}" = "none" ] || [ "${LB_CHROOT_FILESYSTEM}" = "none" ]
then
diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot
index 1c2050fb4..6890f8639 100755
--- a/scripts/build/binary_netboot
+++ b/scripts/build/binary_netboot
@@ -18,11 +18,8 @@ DESCRIPTION="Build netboot binary image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if ! In_list netboot "${LIVE_IMAGE_TYPE}"
then
diff --git a/scripts/build/binary_onie b/scripts/build/binary_onie
index a474ac17b..40c92fbeb 100755
--- a/scripts/build/binary_onie
+++ b/scripts/build/binary_onie
@@ -19,11 +19,8 @@ DESCRIPTION="Build ONIE binary image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_ONIE}" != "true" ]
then
diff --git a/scripts/build/binary_package-lists b/scripts/build/binary_package-lists
index 6c888b0a3..78ccb1754 100755
--- a/scripts/build/binary_package-lists
+++ b/scripts/build/binary_package-lists
@@ -18,11 +18,8 @@ DESCRIPTION="Install local packages into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin installing local package lists..."
diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs
index 716615860..440f5017b 100755
--- a/scripts/build/binary_rootfs
+++ b/scripts/build/binary_rootfs
@@ -18,11 +18,8 @@ DESCRIPTION="Build rootfs image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin building root filesystem image..."
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index 27aea8182..5d2cfdf5f 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -18,11 +18,8 @@ DESCRIPTION="Installs syslinux into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Check_Any_Bootloader_Role "syslinux"
diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar
index 80c51eb3e..cf8bc6980 100755
--- a/scripts/build/binary_tar
+++ b/scripts/build/binary_tar
@@ -18,11 +18,8 @@ DESCRIPTION="Build binary tarball"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if ! In_list tar "${LIVE_IMAGE_TYPE}"
then
diff --git a/scripts/build/binary_win32-loader b/scripts/build/binary_win32-loader
index 31a3dfe26..7ed782b74 100755
--- a/scripts/build/binary_win32-loader
+++ b/scripts/build/binary_win32-loader
@@ -18,11 +18,8 @@ DESCRIPTION="Copy win32-loader into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_WIN32_LOADER}" != "true" ]
then
diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync
index 83b77dd15..5d254d4e4 100755
--- a/scripts/build/binary_zsync
+++ b/scripts/build/binary_zsync
@@ -18,11 +18,8 @@ DESCRIPTION="Build zsync control files"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LIVE_IMAGE_TYPE}" != "iso" ] && [ "${LIVE_IMAGE_TYPE}" != "iso-hybrid" ]
then
diff --git a/scripts/build/bootstrap b/scripts/build/bootstrap
index 101ffc702..aa6ee51c4 100755
--- a/scripts/build/bootstrap
+++ b/scripts/build/bootstrap
@@ -25,11 +25,8 @@ DESCRIPTION="Bootstrap a Debian system"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Setup cleanup function
Setup_cleanup
diff --git a/scripts/build/bootstrap_archives b/scripts/build/bootstrap_archives
index a004890a4..1a345e806 100755
--- a/scripts/build/bootstrap_archives
+++ b/scripts/build/bootstrap_archives
@@ -25,11 +25,8 @@ if [ "${_PASS}" != "binary" ] && [ "${_PASS}" != "source" ]; then
Usage
fi
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache
index b76177b33..e23dc265e 100755
--- a/scripts/build/bootstrap_cache
+++ b/scripts/build/bootstrap_cache
@@ -18,11 +18,8 @@ DESCRIPTION="Cache bootstrap stage"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Check architecture
Check_crossarchitectures
diff --git a/scripts/build/bootstrap_debootstrap b/scripts/build/bootstrap_debootstrap
index 9370c3986..cf7e51355 100755
--- a/scripts/build/bootstrap_debootstrap
+++ b/scripts/build/bootstrap_debootstrap
@@ -18,11 +18,8 @@ DESCRIPTION="Bootstrap a Debian system with debootstrap(8)"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ ! $(which debootstrap) ]
then
diff --git a/scripts/build/build b/scripts/build/build
index dbe37fad5..958bfcb8b 100755
--- a/scripts/build/build
+++ b/scripts/build/build
@@ -38,8 +38,6 @@ DESCRIPTION="Build a Debian Live system"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
if [ ! -d config ]
then
Echo_warning "No config/ directory; using defaults for all options"
@@ -58,9 +56,8 @@ then
exit 1
fi
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Checking defaults
Check_defaults
diff --git a/scripts/build/chroot b/scripts/build/chroot
index 17d065ecc..decf9b68e 100755
--- a/scripts/build/chroot
+++ b/scripts/build/chroot
@@ -25,11 +25,8 @@ DESCRIPTION="Customize the Debian system"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Setup cleanup function
Setup_cleanup
diff --git a/scripts/build/chroot_apt b/scripts/build/chroot_apt
index 733a98bd3..ea77260b0 100755
--- a/scripts/build/chroot_apt
+++ b/scripts/build/chroot_apt
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /etc/apt/apt.conf"
HELP=""
USAGE="${PROGRAM} {install|install-binary|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives
index f1166ae40..5f1e4ffc6 100755
--- a/scripts/build/chroot_archives
+++ b/scripts/build/chroot_archives
@@ -26,11 +26,8 @@ then
Usage
fi
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_cache b/scripts/build/chroot_cache
index caffcdce1..bcd91dc12 100755
--- a/scripts/build/chroot_cache
+++ b/scripts/build/chroot_cache
@@ -18,11 +18,8 @@ DESCRIPTION="Cache chroot stage"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if ! In_list "chroot" ${LB_CACHE_STAGES}
then
diff --git a/scripts/build/chroot_debianchroot b/scripts/build/chroot_debianchroot
index 94690efae..33be77abc 100755
--- a/scripts/build/chroot_debianchroot
+++ b/scripts/build/chroot_debianchroot
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /etc/debian_chroot"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_devpts b/scripts/build/chroot_devpts
index de0c6a164..7def960f5 100755
--- a/scripts/build/chroot_devpts
+++ b/scripts/build/chroot_devpts
@@ -18,11 +18,8 @@ DESCRIPTION="Mount /dev/pts"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg
index 7422cc77f..c496ed0e6 100755
--- a/scripts/build/chroot_dpkg
+++ b/scripts/build/chroot_dpkg
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /sbin/dpkg"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware
index 389728c1b..2ce124c98 100755
--- a/scripts/build/chroot_firmware
+++ b/scripts/build/chroot_firmware
@@ -18,11 +18,8 @@ DESCRIPTION="Schedule kernel packages for installation"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_FIRMWARE_CHROOT}" != "true" ]
then
diff --git a/scripts/build/chroot_hacks b/scripts/build/chroot_hacks
index bba6e48dd..72d97440a 100755
--- a/scripts/build/chroot_hacks
+++ b/scripts/build/chroot_hacks
@@ -18,11 +18,8 @@ DESCRIPTION="Execute hacks in chroot"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin executing hacks..."
diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks
index d6e86e45d..f00820991 100755
--- a/scripts/build/chroot_hooks
+++ b/scripts/build/chroot_hooks
@@ -18,11 +18,8 @@ DESCRIPTION="Execute hooks in chroot"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin executing hooks..."
diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname
index 365a91362..f2aa32cc8 100755
--- a/scripts/build/chroot_hostname
+++ b/scripts/build/chroot_hostname
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /bin/hostname"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_hosts b/scripts/build/chroot_hosts
index 30df74d51..1b148b723 100755
--- a/scripts/build/chroot_hosts
+++ b/scripts/build/chroot_hosts
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /etc/hosts"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_includes b/scripts/build/chroot_includes
index 6222f9f79..f61b5f404 100755
--- a/scripts/build/chroot_includes
+++ b/scripts/build/chroot_includes
@@ -18,11 +18,8 @@ DESCRIPTION="Copy files into chroot"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin copying chroot includes..."
diff --git a/scripts/build/chroot_install-packages b/scripts/build/chroot_install-packages
index 5a618b3df..d7c9af371 100755
--- a/scripts/build/chroot_install-packages
+++ b/scripts/build/chroot_install-packages
@@ -21,11 +21,8 @@ USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin installing packages (${_PASS} pass)..."
diff --git a/scripts/build/chroot_interactive b/scripts/build/chroot_interactive
index fb81bcfc8..c46c84f88 100755
--- a/scripts/build/chroot_interactive
+++ b/scripts/build/chroot_interactive
@@ -18,11 +18,8 @@ DESCRIPTION="Make build interactive"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_INTERACTIVE}" = "false" ]
then
diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image
index fa51b1c14..9bb43718b 100755
--- a/scripts/build/chroot_linux-image
+++ b/scripts/build/chroot_linux-image
@@ -18,11 +18,8 @@ DESCRIPTION="Schedule kernel packages for installation"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_LINUX_PACKAGES}" = "none" ]
then
diff --git a/scripts/build/chroot_package-lists b/scripts/build/chroot_package-lists
index 2d9a9bdc6..ecc63cc12 100755
--- a/scripts/build/chroot_package-lists
+++ b/scripts/build/chroot_package-lists
@@ -21,11 +21,8 @@ USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
diff --git a/scripts/build/chroot_preseed b/scripts/build/chroot_preseed
index d95846d3e..a8bc559f7 100755
--- a/scripts/build/chroot_preseed
+++ b/scripts/build/chroot_preseed
@@ -18,11 +18,8 @@ DESCRIPTION="Execute local preseed in chroot"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin executing local preseeds..."
diff --git a/scripts/build/chroot_proc b/scripts/build/chroot_proc
index 8b1e628a0..48797a3f4 100755
--- a/scripts/build/chroot_proc
+++ b/scripts/build/chroot_proc
@@ -18,11 +18,8 @@ DESCRIPTION="Mount /proc"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_resolv b/scripts/build/chroot_resolv
index 08db67df2..fbde2f57b 100755
--- a/scripts/build/chroot_resolv
+++ b/scripts/build/chroot_resolv
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /etc/resolv.conf"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_selinuxfs b/scripts/build/chroot_selinuxfs
index 7517ae344..59826feb6 100755
--- a/scripts/build/chroot_selinuxfs
+++ b/scripts/build/chroot_selinuxfs
@@ -18,11 +18,8 @@ DESCRIPTION="Mount /sys/fs/selinux"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_sysfs b/scripts/build/chroot_sysfs
index d5ad080ad..0777e45fb 100755
--- a/scripts/build/chroot_sysfs
+++ b/scripts/build/chroot_sysfs
@@ -18,11 +18,8 @@ DESCRIPTION="Mount /sys"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_sysv-rc b/scripts/build/chroot_sysv-rc
index da3730955..d9b5c8aa6 100755
--- a/scripts/build/chroot_sysv-rc
+++ b/scripts/build/chroot_sysv-rc
@@ -18,11 +18,8 @@ DESCRIPTION="Manage /usr/sbin/policy-rc.d"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
diff --git a/scripts/build/chroot_tmpfs b/scripts/build/chroot_tmpfs
index 187f65e39..4a2e88891 100755
--- a/scripts/build/chroot_tmpfs
+++ b/scripts/build/chroot_tmpfs
@@ -18,11 +18,8 @@ DESCRIPTION="Use tmpfs to speedup the build"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_BUILD_WITH_TMPFS}" != "true" ]
then
diff --git a/scripts/build/clean b/scripts/build/clean
index 4e78df612..ce9404b1c 100755
--- a/scripts/build/clean
+++ b/scripts/build/clean
@@ -34,7 +34,7 @@ USAGE="${PROGRAM} [--all] [--cache] [--chroot] [--binary] [--purge] [--remove] [
#Arguments "${@}"
# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
+Read_conffiles $(Common_config_files)
Set_defaults
# Avoid cases were users accidentally nuke their config/binary
diff --git a/scripts/build/config b/scripts/build/config
index e974bc73e..039bf6871 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -186,7 +186,7 @@ Local_arguments ()
Echo "%s: This is live-build version %s" "${0}" "${VERSION_DPKG:-${VERSION}}"
# Dump conffile contents
- Print_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
+ Print_conffiles $(Common_config_files)
# Dump contents of directories that contain text files
for DIRECTORY in config/package-lists config/apt config/preseed config/rootfs
@@ -909,7 +909,7 @@ then
fi
# Reading existing configuration
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
+Read_conffiles $(Common_config_files)
Local_arguments "${@}"
diff --git a/scripts/build/installer b/scripts/build/installer
index 5f25485ce..6ddd1db6d 100755
--- a/scripts/build/installer
+++ b/scripts/build/installer
@@ -25,11 +25,8 @@ DESCRIPTION="Preparing installer images"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Setup cleanup function
Setup_cleanup
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index ca51a1403..831984cf6 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -18,11 +18,8 @@ DESCRIPTION="Install debian-installer into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${_DEBUG}" = "true" ]
then
diff --git a/scripts/build/installer_preseed b/scripts/build/installer_preseed
index 1bcc88973..09203624e 100755
--- a/scripts/build/installer_preseed
+++ b/scripts/build/installer_preseed
@@ -18,12 +18,8 @@ DESCRIPTION="Include local preseed in installer"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
-
+# Processing arguments and configuration files
+Init_config_data "${@}"
# Check d-i configuration
case "${LB_DEBIAN_INSTALLER}" in
diff --git a/scripts/build/source b/scripts/build/source
index 9565c3348..ffcec7100 100755
--- a/scripts/build/source
+++ b/scripts/build/source
@@ -25,11 +25,8 @@ DESCRIPTION="Build source images"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_checksums b/scripts/build/source_checksums
index c01dd98b3..71bca066f 100755
--- a/scripts/build/source_checksums
+++ b/scripts/build/source_checksums
@@ -18,11 +18,8 @@ DESCRIPTION="Create source checksums"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_CHECKSUMS}" = "none" ] || [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_debian b/scripts/build/source_debian
index be05fd4e9..f391745d3 100755
--- a/scripts/build/source_debian
+++ b/scripts/build/source_debian
@@ -18,11 +18,8 @@ DESCRIPTION="Debian sources"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_disk b/scripts/build/source_disk
index 94bd45fbc..13a4bc2a3 100755
--- a/scripts/build/source_disk
+++ b/scripts/build/source_disk
@@ -18,11 +18,8 @@ DESCRIPTION="Install disk information into source"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
case "${LB_SOURCE_IMAGES}" in
iso*|hdd*)
diff --git a/scripts/build/source_hdd b/scripts/build/source_hdd
index 898be4617..564783235 100755
--- a/scripts/build/source_hdd
+++ b/scripts/build/source_hdd
@@ -18,11 +18,8 @@ DESCRIPTION="Build source image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_hooks b/scripts/build/source_hooks
index 289ec223f..c42d143ad 100755
--- a/scripts/build/source_hooks
+++ b/scripts/build/source_hooks
@@ -18,11 +18,8 @@ DESCRIPTION="Execute hooks in source"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/source config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
Echo_message "Begin executing hooks..."
diff --git a/scripts/build/source_iso b/scripts/build/source_iso
index fe4a2d6f6..cc67aa6ed 100755
--- a/scripts/build/source_iso
+++ b/scripts/build/source_iso
@@ -18,11 +18,8 @@ DESCRIPTION="Build iso source image"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_live b/scripts/build/source_live
index 6ddef59df..8b447080a 100755
--- a/scripts/build/source_live
+++ b/scripts/build/source_live
@@ -18,11 +18,8 @@ DESCRIPTION="Copy live config into source"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then
diff --git a/scripts/build/source_tar b/scripts/build/source_tar
index c17475021..cdf92648c 100755
--- a/scripts/build/source_tar
+++ b/scripts/build/source_tar
@@ -18,11 +18,8 @@ DESCRIPTION="Build source tarball"
HELP=""
USAGE="${PROGRAM} [--force]"
-Arguments "${@}"
-
-# Reading configuration files
-Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
-Set_defaults
+# Processing arguments and configuration files
+Init_config_data "${@}"
if [ "${LB_SOURCE}" != "true" ]
then