diff options
author | 2019-11-18 04:05:22 +0100 | |
---|---|---|
committer | 2019-11-21 01:03:31 +0100 | |
commit | eaa588edc7cc99eaa34e503cb07acad2c9960f31 (patch) | |
tree | e83ac38d0ddfbfecbd87bf3c19a81ceedf8c3ae8 /gen_configkernel.sh | |
parent | gen_determineargs.sh: determine_real_args(): clarify $SSH_AUTHORIZED_KEYS_FIL... (diff) | |
download | genkernel-eaa588edc7cc99eaa34e503cb07acad2c9960f31.tar.gz genkernel-eaa588edc7cc99eaa34e503cb07acad2c9960f31.tar.bz2 genkernel-eaa588edc7cc99eaa34e503cb07acad2c9960f31.zip |
gen_configkernel.sh: determine_kernel_config_file(): clarify $KERNEL_CONFIG errors
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_configkernel.sh')
-rwxr-xr-x | gen_configkernel.sh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 28382fe7..d95368f0 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -10,10 +10,22 @@ determine_kernel_config_file() { KERNEL_CONFIG=$(expand_file "${CMD_KERNEL_CONFIG}") if [ -z "${KERNEL_CONFIG}" ] then - error_msg="No kernel .config: Cannot use '${CMD_KERNEL_CONFIG}' value. " - error_msg+="Check --kernel-config value or unset " - error_msg+="to use default kernel config provided by genkernel." - gen_die "${error_msg}" + gen_die "--kernel-config value '${CMD_KERNEL_CONFIG}' failed to expand!" + elif [ ! -e "${KERNEL_CONFIG}" ] + then + gen_die "--kernel-config file '${KERNEL_CONFIG}' does not exist!" + fi + + if isTrue "$(is_gzipped "${KERNEL_CONFIG}")" + then + local CONFGREP=zgrep + else + local CONFGREP=grep + fi + + if ! ${CONFGREP} -qE '^CONFIG_.*=' "${KERNEL_CONFIG}" &>/dev/null + then + gen_die "--kernel-config file '${KERNEL_CONFIG}' does not look like a valid kernel config: File does not contain any CONFIG_* value!" fi else local -a kconfig_candidates |