diff options
author | 2019-11-21 01:00:45 +0100 | |
---|---|---|
committer | 2019-11-24 20:59:16 +0100 | |
commit | 547207d7db8c6ab5418cb09b6da3afbed0b6e146 (patch) | |
tree | afd6545ce9a6064b9ad95f81eaf49e106ad8ee9e /gen_determineargs.sh | |
parent | genkernel: Check for [z]grep (diff) | |
download | genkernel-547207d7db8c6ab5418cb09b6da3afbed0b6e146.tar.gz genkernel-547207d7db8c6ab5418cb09b6da3afbed0b6e146.tar.bz2 genkernel-547207d7db8c6ab5418cb09b6da3afbed0b6e146.zip |
gen_compile.sh: determine_busybox_config_file(): Move --busybox-config validation to determine_real_args()
This will allow us to fail early.
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_determineargs.sh')
-rwxr-xr-x | gen_determineargs.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 5bbe33f..2b68a8a 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -923,6 +923,25 @@ determine_real_args() { fi done unset FEATURE_REQUIRING_BUSYBOX FEATURES_REQUIRING_BUSYBOX + elif [ -n "${CMD_BUSYBOX_CONFIG}" ] + then + local BUSYBOX_CONFIG=$(expand_file "${CMD_BUSYBOX_CONFIG}") + if [ -z "${BUSYBOX_CONFIG}" ] + then + gen_die "--busybox-config value '${CMD_BUSYBOX_CONFIG}' failed to expand!" + elif [ ! -e "${BUSYBOX_CONFIG}" ] + then + gen_die "--busybox-config file '${BUSYBOX_CONFIG}' does not exist!" + fi + + if ! grep -qE '^CONFIG_.*=' "${BUSYBOX_CONFIG}" &>/dev/null + then + gen_die "--busybox-config file '${BUSYBOX_CONFIG}' does not look like a valid busybox config: File does not contain any CONFIG_* value!" + elif ! grep -qE '^CONFIG_STATIC=y$' "${BUSYBOX_CONFIG}" &>/dev/null + then + # We cannot check all required options but check at least for CONFIG_STATIC... + gen_die "--busybox-config file '${BUSYBOX_CONFIG}' does not contain CONFIG_STATIC=y. This busybox config will not work with genkernel!" + fi fi DU_COMMAND="$(which du 2>/dev/null)" |