diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-04-15 20:30:29 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-15 20:33:16 +0200 |
commit | 90dcd0a18133c2d580826e8649103e1f33b00bfe (patch) | |
tree | 0bcf1d99d4d16963aa22bed568bf1cdb3354aa64 | |
parent | 130354792bff05fd4c4561a1897c557e0d044828 (diff) |
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 <johannes.berg@intel.com>
-rw-r--r-- | backport/Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/backport/Makefile b/backport/Makefile index fde14bf4..5cb70169 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 ..." ;\ |