kernel: Halt build process if an external module fails to compile
Before:
mka bootimage
qcacld failed to compile, but boot.img is generated
After:
mka bootimage
qcacld failed to compile and no boot.img is generated
Commit fadfdbf introduced the idea of building external modules,
but it didn't account for the scenario where compilation could fail
while the boot.img is still being built.
Fix this by properly stopping the build process as soon as the external
module fails to compile.
Change-Id: Ifed28825f8e4b78d304fe62a47908e208edfb886
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index b2ae280..38d26fb 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -454,8 +454,8 @@
rpath=$$(python3 -c 'import os,sys;print(os.path.relpath(*(sys.argv[1:])))' $(TARGET_KERNEL_EXT_MODULE_ROOT) $(KERNEL_SRC)); \
$(foreach p, $(TARGET_KERNEL_EXT_MODULES),\
$$pwd; \
- $(call make-external-module-target,$(p),$$rpath,); \
- $(call make-external-module-target,$(p),$$rpath,INSTALL_MOD_PATH=$(MODULES_INTERMEDIATES) INSTALL_MOD_STRIP=1 KERNEL_UAPI_HEADERS_DIR=$(KERNEL_OUT) modules_install)); \
+ $(call make-external-module-target,$(p),$$rpath,) || exit "$$?"; \
+ $(call make-external-module-target,$(p),$$rpath,INSTALL_MOD_PATH=$(MODULES_INTERMEDIATES) INSTALL_MOD_STRIP=1 KERNEL_UAPI_HEADERS_DIR=$(KERNEL_OUT) modules_install)) || exit "$$?"; \
) \
kernel_release=$$(cat $(KERNEL_RELEASE)) \
kernel_modules_dir=$(MODULES_INTERMEDIATES)/lib/modules/$$kernel_release \