Skip to content

Commit

Permalink
[DellEMC] Dell Platform Modules Debian Build Error Fix (#4108)
Browse files Browse the repository at this point in the history
- Fix for sonic-net/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".
  • Loading branch information
santhosh-kt authored Feb 7, 2020
1 parent 9c73df9 commit 57d4c84
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions platform/broadcom/sonic-platform-modules-dell/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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); \
Expand All @@ -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; \
Expand All @@ -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

0 comments on commit 57d4c84

Please sign in to comment.