Handle missing kernel Makefile better
authorSebastian Pipping <sebastian@pipping.org>
Thu, 13 Jan 2011 13:30:45 +0000 (14:30 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Thu, 13 Jan 2011 13:30:57 +0000 (14:30 +0100)
gen_determineargs.sh

index d34e5bc2d00154e75bcdec318b5dc660d28b20b2..f830c48c307cd6a815c0c4ca9f1985129ddea14c 100755 (executable)
@@ -20,6 +20,11 @@ get_KV() {
                # Configure the kernel
                # If BUILD_KERNEL=0 then assume --no-clean, menuconfig is cleared
 
+               if [ ! -f "${KERNEL_DIR}"/Makefile ]
+               then
+                       gen_die "Kernel Makefile (${KERNEL_DIR}/Makefile) missing.  Maybe re-install the kernel sources."
+               fi
+
                VER=`grep ^VERSION\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
                PAT=`grep ^PATCHLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
                SUB=`grep ^SUBLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
@@ -29,6 +34,7 @@ get_KV() {
                then
                        # Handle O= build directories
                        KERNEL_SOURCE_DIR=`grep ^MAKEARGS\ \:\=  ${KERNEL_DIR}/Makefile | awk '{ print $4 };'`
+                       [ -z "${KERNEL_SOURCE_DIR}" ] && gen_die "Deriving \${KERNEL_SOURCE_DIR} failed"
                        SUB=`grep ^SUBLEVEL\ \= ${KERNEL_SOURCE_DIR}/Makefile | awk '{ print $3 };'`
                        EXV=`grep ^EXTRAVERSION\ \= ${KERNEL_SOURCE_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g" -e 's/\$([a-z]*)//gi'`
                fi