diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-04-01 05:22:39 +0100 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-04-23 09:38:02 +0000 |
commit | e22bd27170bba862239c41ebdd9a6f23ef865caf (patch) | |
tree | ef5e94ab59d716835f21a8e706ef80bc909e3dcc /scripts/build/binary | |
parent | fc88358b29bc353b15879d611cc25fc74ae91442 (diff) | |
download | vyos-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/binary')
-rwxr-xr-x | scripts/build/binary | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/scripts/build/binary b/scripts/build/binary index ac24a4f4a..49e0e994b 100755 --- a/scripts/build/binary +++ b/scripts/build/binary @@ -30,18 +30,16 @@ Setup_clean_exit # Preparing root filesystem lb binary_chroot "${@}" +# Chroot preparation component lists +# We deliberately exclude 'debianchroot' and 'tmpfs' +CHROOT_PREP_MOUNTS="devpts proc selinuxfs sysfs" +CHROOT_PREP_OTHER="dpkg sysv-rc hosts resolv hostname" + if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] then # Configuring chroot - lb chroot_devpts install "${@}" - lb chroot_proc install "${@}" - lb chroot_selinuxfs install "${@}" - lb chroot_sysfs install "${@}" - lb chroot_hosts install "${@}" - lb chroot_resolv install "${@}" - lb chroot_hostname install "${@}" - lb chroot_dpkg install "${@}" - lb chroot_sysv-rc install "${@}" + lb chroot_prep install "${CHROOT_PREP_MOUNTS}" "${@}" + lb chroot_prep install "${CHROOT_PREP_OTHER}" "${@}" lb chroot_apt install-binary "${@}" lb chroot_archives chroot install "${@}" fi @@ -68,10 +66,7 @@ lb binary_checksums "${@}" if [ "${LB_BUILD_WITH_CHROOT}" != "true" ] then - lb chroot_devpts install "${@}" - lb chroot_proc install "${@}" - lb chroot_selinuxfs install "${@}" - lb chroot_sysfs install "${@}" + lb chroot_prep install "${CHROOT_PREP_MOUNTS}" "${@}" fi # Building images @@ -89,16 +84,9 @@ then Remove_stagefile chroot_archives lb chroot_apt remove "${@}" - lb chroot_hostname remove "${@}" - lb chroot_resolv remove "${@}" - lb chroot_hosts remove "${@}" - lb chroot_sysv-rc remove "${@}" - lb chroot_dpkg remove "${@}" + lb chroot_prep remove "${CHROOT_PREP_OTHER}" "${@}" fi -lb chroot_sysfs remove "${@}" -lb chroot_selinuxfs remove "${@}" -lb chroot_proc remove "${@}" -lb chroot_devpts remove "${@}" +lb chroot_prep remove "${CHROOT_PREP_MOUNTS}" "${@}" Echo_message "Binary stage completed" |