From: Michael Meffie Date: Tue, 3 Jun 2014 03:24:45 +0000 (-0400) Subject: linux: dont ignore kmod build errors X-Git-Tag: upstream/1.6.10_pre1^2~99 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1423a3debec3ec5a67c0ef1c613c02a266529e45;p=packages%2Fo%2Fopenafs.git linux: dont ignore kmod build errors Errors from the linux kmod build are not propagated, since make is run as the first command in a pipeline, and the shell returns the exit code of the last command in the pipeline. Run the make command in a subshell to detect errors, and exit afterwards. (This method is more portable than bash specific pipeline processing options.) Thanks to Mark Vitale for pointing out this build system defect to me. Reviewed-on: http://gerrit.openafs.org/11186 Tested-by: BuildBot Reviewed-by: Mark Vitale Tested-by: Mark Vitale Reviewed-by: D Brashear (cherry picked from commit 48789d47b613e40734e7b0caac58572a80f8b318) Change-Id: Idbdfad2a50901041aedaed35b8f01d713a66620d Reviewed-on: http://gerrit.openafs.org/11205 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Anders Kaseorg Reviewed-by: Stephan Wiesand --- diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index e2c96ee13..a79119d39 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -340,9 +340,11 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko .FORCE: ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common - env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules 2>&1 | tee .makelog - @if [ `grep ^WARNING .makelog | wc -l` -ne 0 ]; then \ - echo Error: Undefined symbols in modules ; \ + ( env EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules 2>&1 \ + || echo "FAILURE: make exit code $$?" ) | tee .makelog + @if grep -E -q '^(FAILURE|WARNING)' .makelog; then \ + grep -q '^WARNING' .makelog && echo "Error: Undefined symbols in modules" ; \ rm .makelog ; \ exit 1 ; \ fi