diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-03-28 06:11:15 +0000 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-04-23 14:53:06 +0200 |
commit | f8a401f068a83f71ac266f91dc07c4228f5efff7 (patch) | |
tree | 65cfdd3642581d3f6b2881cf80ca26678fdb40bd /scripts | |
parent | 5fb790e43e5dff20340278f9ca7a66939b0f15f9 (diff) | |
download | vyos-live-build-f8a401f068a83f71ac266f91dc07c4228f5efff7.tar.gz vyos-live-build-f8a401f068a83f71ac266f91dc07c4228f5efff7.zip |
config: add --validate option
running `lb config --validate` causes the script to stop after running
the validation check on the config compiled at that point, prior to
writing the config to disk.
this gives users the ability to check the validity of a config without
modifying or rewriting the saved config.
note that if users provide new config options alongside --validate, these
are taken into account in the check performed.
the 'check complete' message will not be seen if an error is reported by
the check function, while it will be seen if only warnings are given, but
it would require a redesign of the validation check function to make any
improvement in that area, and it's perhaps not worth it.
Gbp-Dch: Short
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/config | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/build/config b/scripts/build/config index d9ada6f84..9c375b4b9 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -129,6 +129,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--tasksel apt|aptitude|tasksel]\n\ \t [--uefi-secure-boot auto|enable|disable]\n\ \t [--updates true|false]\n\ +\t [--validate]\n\ \t [--verbose]\n\ \t [--win32-loader true|false]\n\ \t [--zsync true|false]" @@ -159,7 +160,7 @@ Local_arguments () net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:, net-cow-server:,net-tarball:,onie:,onie-kernel-cmdline:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:, loadlin:,win32-loader:,source:,source-images:,breakpoints,conffile:,color,no-color,debug,force, - help,ignore-system-defaults,quiet,usage,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:, + help,ignore-system-defaults,quiet,usage,validate,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:, uefi-secure-boot:, bootstrap-qemu-exclude:" # Remove spaces added by indentation @@ -220,6 +221,11 @@ Local_arguments () exit 0 ;; + --validate) + _VALIDATE_MODE="true" + shift + ;; + --clean) _CLEAN="true" shift @@ -940,6 +946,11 @@ fi Prepare_config Validate_config +if [ "${_VALIDATE_MODE}" = "true" ]; then + Echo_message "Validation check complete! Please address any problem notices given above." + exit 0 +fi + # Creating or updating saved config if [ ! -e config ] |