2018-08-13 05:31:11 -05:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export INSTALL_MOD_DIR:=extra
|
|
|
|
|
|
|
|
KVERSION ?= $(shell uname -r)
|
|
|
|
KERNEL_SRC := /lib/modules/$(KVERSION)
|
|
|
|
MOD_SRC_DIR:= $(shell pwd)
|
2019-12-17 17:26:23 -06:00
|
|
|
MODULE_DIRS:= s6000 z9100 s6100 z9264f s5232f s5248f z9332f
|
2018-08-13 05:31:11 -05:00
|
|
|
COMMON_DIR := common
|
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
2020-02-07 09:49:08 -06:00
|
|
|
set -e; \
|
2018-08-13 05:31:11 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
if [ $$mod = "s6100" ]; then \
|
2018-09-09 02:13:19 -05:00
|
|
|
cp $(COMMON_DIR)/dell_pmc.c $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \
|
|
|
|
cp $(COMMON_DIR)/dell_ich.c $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2018-08-13 05:31:11 -05:00
|
|
|
elif [ $$mod = "z9100" ]; then \
|
2018-09-09 02:13:19 -05:00
|
|
|
cp $(COMMON_DIR)/dell_pmc.c $(MOD_SRC_DIR)/$${mod}/modules/dell_mailbox.c; \
|
|
|
|
cp $(COMMON_DIR)/dell_ich.c $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2019-07-24 14:15:46 -05:00
|
|
|
elif [ $$mod = "s6000" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2020-01-23 11:32:34 -06:00
|
|
|
elif [ $$mod = "z9264f" ]; then \
|
2020-01-29 00:06:04 -06:00
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
2020-01-23 11:32:34 -06:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2020-05-20 16:40:39 -05:00
|
|
|
elif [ $$mod = "s5232f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2018-08-13 05:31:11 -05:00
|
|
|
fi; \
|
|
|
|
echo "making man page alias $$mod -> $$mod APIs";\
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
2020-02-07 09:49:08 -06:00
|
|
|
done); \
|
|
|
|
set +e
|
2018-08-13 05:31:11 -05:00
|
|
|
|
|
|
|
override_dh_auto_install:
|
2020-02-07 09:49:08 -06:00
|
|
|
set -e; \
|
2018-08-13 05:31:11 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
dh_installdirs -pplatform-modules-$${mod} \
|
|
|
|
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
cp $(MOD_SRC_DIR)/$${mod}/modules/*.ko \
|
|
|
|
debian/platform-modules-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2019-06-25 14:23:24 -05:00
|
|
|
if [ $$mod = "s6000" ]; then \
|
|
|
|
dh_installdirs -pplatform-modules-$${mod} usr/local/bin ; \
|
|
|
|
cp -r $(MOD_SRC_DIR)/$${mod}/scripts/* debian/platform-modules-$${mod}/usr/local/bin; \
|
|
|
|
fi; \
|
2020-02-07 09:49:08 -06:00
|
|
|
done); \
|
|
|
|
set +e
|
2018-08-13 05:31:11 -05:00
|
|
|
|
|
|
|
override_dh_usrlocal:
|
|
|
|
|
|
|
|
override_dh_clean:
|
|
|
|
dh_clean
|
2020-02-07 09:49:08 -06:00
|
|
|
set -e; \
|
2018-08-13 05:31:11 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
if [ $$mod = "s6100" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \
|
2018-09-09 02:13:19 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2018-08-13 05:31:11 -05:00
|
|
|
elif [ $$mod = "z9100" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_mailbox.c; \
|
2018-09-09 02:13:19 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2019-07-24 14:15:46 -05:00
|
|
|
elif [ $$mod = "s6000" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2020-01-23 11:32:34 -06:00
|
|
|
elif [ $$mod = "z9264f" ]; then \
|
2020-01-29 00:06:04 -06:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
2020-01-23 11:32:34 -06:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2020-05-20 16:40:39 -05:00
|
|
|
elif [ $$mod = "s5232f" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2018-08-13 05:31:11 -05:00
|
|
|
fi; \
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
2020-02-07 09:49:08 -06:00
|
|
|
done); \
|
|
|
|
set +e
|
2018-08-13 05:31:11 -05:00
|
|
|
|