From: Johannes Berg Date: Mon, 15 Apr 2013 18:30:29 +0000 (+0200) Subject: backport build system: warn if kernel headers aren't there X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=90dcd0a18133c2d580826e8649103e1f33b00bfe;p=openwrt%2Fstaging%2Fblogic.git backport build system: warn if kernel headers aren't there When the kernel build system/configuration isn't present, warn verbosely instead of later failing with crypting errors. Signed-off-by: Johannes Berg --- diff --git a/backport/Makefile b/backport/Makefile index fde14bf463f3..5cb701691979 100644 --- a/backport/Makefile +++ b/backport/Makefile @@ -18,7 +18,7 @@ endif KLIB_BUILD ?= $(KLIB)/build/ KERNEL_CONFIG := $(KLIB_BUILD)/.config KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile -CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) | sed 's/\s.*//') +CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//') export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG @@ -30,6 +30,17 @@ default: @$(MAKE) modules .DEFAULT: + @set -e ; test -f $(KERNEL_CONFIG) || ( \ + echo "/--------------" ;\ + echo "| Your kernel headers are incomplete/not installed." ;\ + echo "| Please install kernel headers, including a .config" ;\ + echo "| file or use the KLIB/KLIB_BUILD make variables to" ;\ + echo "| set the kernel to build against, e.g." ;\ + echo "| make KLIB=/lib/modules/3.1.7/" ;\ + echo "| to compile/install for the installed kernel 3.1.7" ;\ + echo "| (that isn't currently running.)" ;\ + echo "\\--" ;\ + false) @set -e ; if [ "$$(cat .kernel_config_md5 2>/dev/null)" != "$(CONFIG_MD5)" ] ;\ then \ echo -n "Generating local configuration database from kernel ..." ;\