summaryrefslogtreecommitdiff
path: root/scripts/build/source
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-04-01 05:22:39 +0100
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 09:38:02 +0000
commite22bd27170bba862239c41ebdd9a6f23ef865caf (patch)
treeef5e94ab59d716835f21a8e706ef80bc909e3dcc /scripts/build/source
parentfc88358b29bc353b15879d611cc25fc74ae91442 (diff)
downloadvyos-live-build-e22bd27170bba862239c41ebdd9a6f23ef865caf.tar.gz
vyos-live-build-e22bd27170bba862239c41ebdd9a6f23ef865caf.zip
add bulk chroot preparation script execution helper
rather than explicitly running one helper after another in the major build stages, or by hand (e.g. while testing things during development), they can be run in bulk via this new helper. it essentially just takes a list of helpers to run and runs them one by one. it supports running all helpers except chroot_archives because that one has different parameter requirements to the rest and supporting it would make things messier. helper scripts can either be named by their full script name or without the 'chroot_' prefix for brevity. you can also just specify 'all' to refer to all helpers (except chroot_archives, per above). it automatically reverses the order of the list when run in remove mode. Gbp-Dch: Short
Diffstat (limited to 'scripts/build/source')
-rwxr-xr-xscripts/build/source10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/build/source b/scripts/build/source
index 7e03c337c..9fe0dc8e0 100755
--- a/scripts/build/source
+++ b/scripts/build/source
@@ -32,10 +32,10 @@ fi
# Setting up cleanup function
Setup_clean_exit
+CHROOT_PREP="hosts resolv hostname"
+
# Configuring chroot (enabling networking)
-lb chroot_hosts install "${@}"
-lb chroot_resolv install "${@}"
-lb chroot_hostname install "${@}"
+lb chroot_prep install "${CHROOT_PREP}" "${@}"
lb chroot_archives source install "${@}"
# Preparing images
@@ -52,8 +52,6 @@ lb source_hdd "${@}"
# Deconfiguring chroot
lb chroot_archives source remove "${@}"
-lb chroot_hostname remove "${@}"
-lb chroot_resolv remove "${@}"
-lb chroot_hosts remove "${@}"
+lb chroot_prep remove "${CHROOT_PREP}" "${@}"
Echo_message "Source stage completed"