summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/kernel_linux.in5
-rw-r--r--scripts/build/kernel_linux.sh17
2 files changed, 18 insertions, 4 deletions
diff --git a/config/kernel_linux.in b/config/kernel_linux.in
index c1699ae..4d74961 100644
--- a/config/kernel_linux.in
+++ b/config/kernel_linux.in
@@ -117,8 +117,9 @@ config KERNEL_LINUX_CONFIG_FILE
prompt "Configuration file"
default ""
help
- Path to the kernel configuration file.
+ Path to a kernel configuration file.
- You _must_ provide one (for now).
+ If you don't provide one, then the default configuration for
+ your target will be used.
endif
diff --git a/scripts/build/kernel_linux.sh b/scripts/build/kernel_linux.sh
index d9d4de5..f23487f 100644
--- a/scripts/build/kernel_linux.sh
+++ b/scripts/build/kernel_linux.sh
@@ -6,8 +6,21 @@
do_kernel_check_config() {
CT_DoStep INFO "Checking kernel configuration"
- if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" ]; then
- CT_TestOrAbort "You did not provide a kernel config file!" -n "${CT_KERNEL_LINUX_CONFIG_FILE}" -a -f "${CT_KERNEL_LINUX_CONFIG_FILE}"
+ if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" \
+ -a \( -z "${CT_KERNEL_LINUX_CONFIG_FILE}" -o ! -r "${CT_KERNEL_LINUX_CONFIG_FILE}" \) ]; then
+ CT_DoLog WARN "You did not provide a kernel configuration file!"
+ CT_DoLog WARN "I will try to generate one for you, but beware!"
+
+ CT_DoStep INFO "Building a default configuration file for linux kernel"
+
+ mkdir -p "${CT_BUILD_DIR}/build-kernel-defconfig"
+ cd "${CT_BUILD_DIR}/build-kernel-defconfig"
+ make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" O=`pwd` \
+ ARCH=${CT_KERNEL_ARCH} defconfig 2>&1 |CT_DoLog DEBUG
+
+ CT_KERNEL_LINUX_CONFIG_FILE="`pwd`/.config"
+
+ CT_EndStep
fi
CT_EndStep