sonic-buildimage/platform/barefoot/sonic-platform-modules-netberg/debian/rules
Andrew Sapronov 7f10b6bc35
[Netberg][Barefoot] Added support for Aurora 610 (#10579)
Why I did it
Support Intel Tofino based platforms Netberg Aurora 610
ASIC: Intel Tofino BFN-T10-032D-020
Pors: 48x 25G + 8x 100G

How I did it
Added specification to device/netberg directory
Added platform/barefoot/sonic-platform-modules-netberg contains kernel modules, scripts and sonic_platform packages.
Modified the platform/barefoot/one-image.mk and platform/barefoot/rule.mk to include Aurora 610 related ID and files.

How to verify it
Build SONiC

Install the image on the device and verify the related components are installed and shown correctly.
2022-06-30 10:40:47 -07:00

48 lines
1.4 KiB
Makefile
Executable File

#!/usr/bin/make -f
export INSTALL_MOD_DIR:=extra
PYTHON3 ?= python3
PACKAGE_PRE_NAME := sonic-platform-netberg
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
MOD_SRC_DIR:= $(shell pwd)
MODULE_DIRS:= aurora-610
MODULE_DIR := modules
UTILS_DIR := utils
SERVICE_DIR := service
CONF_DIR := conf
%:
dh $@ --with systemd
override_dh_auto_build:
(for mod in $(MODULE_DIRS); do \
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
cd $(MOD_SRC_DIR)/$${mod}; \
$(PYTHON3) setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
cd $(MOD_SRC_DIR); \
done)
override_dh_auto_install:
(for mod in $(MODULE_DIRS); do \
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} \
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko \
debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service \
debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \
cd $(MOD_SRC_DIR)/$${mod}; \
python3 setup.py install --root=$(MOD_SRC_DIR)/debian/platform-modules-$${mod} --install-layout=deb; \
cd $(MOD_SRC_DIR); \
done)
override_dh_clean:
dh_clean
(for mod in $(MODULE_DIRS); do \
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
done)