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)
|
2022-06-15 11:39:41 -05:00
|
|
|
MODULE_DIRS:= s6000 z9100 s6100 z9264f s5212f s5224f s5232f s5248f z9332f z9432f s5296f n3248pxe n3248te
|
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}; \
|
2020-10-17 14:31:55 -05:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2019-07-03 08:52:35 -05:00
|
|
|
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}; \
|
2020-10-17 14:31:55 -05:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2019-07-03 08:52:35 -05:00
|
|
|
cd $(MOD_SRC_DIR); \
|
2019-07-24 14:15:46 -05:00
|
|
|
elif [ $$mod = "s6000" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
2020-10-17 14:31:55 -05:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2019-07-24 14:15:46 -05:00
|
|
|
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}; \
|
2020-10-17 14:31:55 -05:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2020-01-23 11:32:34 -06:00
|
|
|
cd $(MOD_SRC_DIR); \
|
2021-10-26 14:52:03 -05:00
|
|
|
elif [ $$mod = "s5212f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2021-09-26 11:34:16 -05:00
|
|
|
elif [ $$mod = "s5224f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 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}; \
|
2020-10-17 14:31:55 -05:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2020-05-20 16:40:39 -05:00
|
|
|
cd $(MOD_SRC_DIR); \
|
2021-06-28 11:44:49 -05:00
|
|
|
elif [ $$mod = "s5248f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2021-09-23 22:47:32 -05:00
|
|
|
elif [ $$mod = "n3248te" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2020-12-10 12:30:44 -06:00
|
|
|
elif [ $$mod = "z9332f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2022-06-15 11:39:41 -05:00
|
|
|
elif [ $$mod = "z9432f" ]; then \
|
|
|
|
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2021-09-25 17:35:16 -05:00
|
|
|
elif [ $$mod = "n3248pxe" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 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:
|
|
|
|
|
2022-08-02 11:56:17 -05:00
|
|
|
override_dh_installmodules:
|
|
|
|
dh_installmodules --no-scripts;
|
|
|
|
|
2018-08-13 05:31:11 -05:00
|
|
|
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; \
|
2021-10-26 14:52:03 -05:00
|
|
|
elif [ $$mod = "s5212f" ]; 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; \
|
2021-09-26 11:34:16 -05:00
|
|
|
elif [ $$mod = "s5224f" ]; 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; \
|
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; \
|
2021-06-28 11:44:49 -05:00
|
|
|
elif [ $$mod = "s5248f" ]; 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; \
|
2020-12-10 12:30:44 -06:00
|
|
|
elif [ $$mod = "z9332f" ]; 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; \
|
2022-06-15 11:39:41 -05:00
|
|
|
elif [ $$mod = "z9432f" ]; 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; \
|
2021-09-25 17:35:16 -05:00
|
|
|
elif [ $$mod = "n3248pxe" ]; 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; \
|
2021-09-23 22:47:32 -05:00
|
|
|
elif [ $$mod = "n3248te" ]; 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
|
|
|
|