aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-11-21 01:00:45 +0100
committerThomas Deutschmann <whissi@gentoo.org>2019-11-24 20:59:16 +0100
commit547207d7db8c6ab5418cb09b6da3afbed0b6e146 (patch)
treeafd6545ce9a6064b9ad95f81eaf49e106ad8ee9e /gen_determineargs.sh
parentgenkernel: Check for [z]grep (diff)
downloadgenkernel-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-xgen_determineargs.sh19
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)"