summaryrefslogtreecommitdiff
path: root/functions/init.sh
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-04 01:34:05 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-04 13:26:19 +0100
commit943c8fb5feb27cd60fd335f6e9e77524127f0f17 (patch)
treef0cdc5e267fd9e4cb8fcdace8faf3cd6c54127ca /functions/init.sh
parent7acd1f488f3b9d4348449a27d9412488dc8e1657 (diff)
downloadvyos-live-build-943c8fb5feb27cd60fd335f6e9e77524127f0f17.tar.gz
vyos-live-build-943c8fb5feb27cd60fd335f6e9e77524127f0f17.zip
extend config validation to all build components
while `lb build` ran the config validation check, spotting invalid configs and stopping with an error, the major build stages if executed directly did not, nor did the component stages. here we move execution of the validation function into the common init function, with an exported variable used to indicate that validation has been performed. thus validation is performed no matter what part of the build system you execute, but only once. Gbp-Dch: Short
Diffstat (limited to 'functions/init.sh')
-rwxr-xr-xfunctions/init.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/functions/init.sh b/functions/init.sh
index 708e3d275..0182f413d 100755
--- a/functions/init.sh
+++ b/functions/init.sh
@@ -25,6 +25,12 @@ Init_config_data ()
Read_conffiles $(Common_conffiles)
Prepare_config
+ # Validating config
+ if [ "${CONFIG_VALIDATED}" != "true" ]; then
+ Validate_config
+ export CONFIG_VALIDATED="true"
+ fi
+
# Apt v2.0.1 introduced color support, but it needs to be explicitly enabled.
# This is done here so that the injection of the option does not get stored in the config file.
if [ "${_COLOR_OUT}" = "true" ] && [ "${_COLOR_ERR}" = "true" ]; then