[platform]: Add rules to build cavium platform modules (#186)

* Added rules to build cavium platform modules
* Use correct kernel version

Signed-off-by: Nadiya.Stetskovych <Nadiya.Stetskovych@cavium.com>
This commit is contained in:
Nadiya 2017-01-13 04:02:19 +02:00 committed by Shuotian Cheng
parent 387399663f
commit ae4b72e866
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,4 @@
CAVM_PLATFORM_DEB = cavm_platform_modules.deb
$(CAVM_PLATFORM_DEB)_SRC_PATH = $(PLATFORM_PATH)/cavm_platform_modules
SONIC_MAKE_DEBS += $(CAVM_PLATFORM_DEB)

View File

@ -0,0 +1,6 @@
cavm-platform-modules (1.0) unstable; urgency=low
* Initial release
-- Nadiya.Stetskovych@cavium.com Thu, 12 Jan 2017 19:24:41 +0200

View File

@ -0,0 +1,6 @@
Package: cavm-platform-modules
Version: 1.0
Architecture: amd64
Depends: linux-image-3.16.0-4-amd64
Maintainer: Nadiya.Stetskovych@cavium.com
Description: kernel modules for platform devices such as fan, led, sfp

View File

@ -0,0 +1,26 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e
MAIN_TARGET = cavm_platform_modules.deb
DEB_BUILD_DIR = cavm-platform-modules-deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf SONiC
git clone https://github.com/edge-core/SONiC.git
# build
pushd SONiC/AS7512-32X/module/
KERNEL_SRC=/lib/modules/$(KVERSION)/build make
popd
mkdir -p $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
cp SONiC/AS7512-32X/module/*.ko $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
cp -r DEBIAN $(DEB_BUILD_DIR)
dpkg-deb -b $(DEB_BUILD_DIR) $(MAIN_TARGET)
mv $(MAIN_TARGET) $(DEST)/
rm -rf $(DEB_BUILD_DIR)

View File

@ -3,6 +3,7 @@ include $(PLATFORM_GENERIC_PATH)/rules.mk
include $(PLATFORM_PATH)/cavm-sai.mk
include $(PLATFORM_PATH)/docker-syncd-cavm.mk
include $(PLATFORM_PATH)/docker-orchagent-cavm.mk
include $(PLATFORM_PATH)/cavm_platform_modules.mk
SONIC_ALL += $(DOCKER_SYNCD_CAVM) \
$(DOCKER_ORCHAGENT_CAVM)