From 57d4c841dbd56144c460daa7944482dc208e3dad Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Fri, 7 Feb 2020 21:19:08 +0530 Subject: [PATCH] [DellEMC] Dell Platform Modules Debian Build Error Fix (#4108) - Fix for Azure/sonic-buildimage#4095 - Exit status from failed make command(action) didnt reached parent target because the make command is inside the "for" loop. - Only the exit status of the last command in the last iteration of the for loop is read by parent target. - This is the reason why dpkg-buildpackage ignored the make error. - Fixed the issue with help of "set -e". --- .../sonic-platform-modules-dell/debian/rules | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/rules b/platform/broadcom/sonic-platform-modules-dell/debian/rules index d3ba62afa4..3f0f799798 100755 --- a/platform/broadcom/sonic-platform-modules-dell/debian/rules +++ b/platform/broadcom/sonic-platform-modules-dell/debian/rules @@ -12,6 +12,7 @@ COMMON_DIR := common dh $@ override_dh_auto_build: + set -e; \ (for mod in $(MODULE_DIRS); do \ if [ $$mod = "s6100" ]; then \ cp $(COMMON_DIR)/dell_pmc.c $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \ @@ -37,9 +38,11 @@ override_dh_auto_build: fi; \ echo "making man page alias $$mod -> $$mod APIs";\ make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ - done) + done); \ + set +e override_dh_auto_install: + set -e; \ (for mod in $(MODULE_DIRS); do \ dh_installdirs -pplatform-modules-$${mod} \ $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ @@ -49,12 +52,14 @@ override_dh_auto_install: dh_installdirs -pplatform-modules-$${mod} usr/local/bin ; \ cp -r $(MOD_SRC_DIR)/$${mod}/scripts/* debian/platform-modules-$${mod}/usr/local/bin; \ fi; \ - done) + done); \ + set +e override_dh_usrlocal: override_dh_clean: dh_clean + set -e; \ (for mod in $(MODULE_DIRS); do \ if [ $$mod = "s6100" ]; then \ rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \ @@ -79,5 +84,6 @@ override_dh_clean: rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \ fi; \ make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \ - done) + done); \ + set +e