Skip to content

Commit

Permalink
[platform]: Add rules to build cavium platform modules (#186)
Browse files Browse the repository at this point in the history
* Added rules to build cavium platform modules
* Use correct kernel version

Signed-off-by: Nadiya.Stetskovych <Nadiya.Stetskovych@cavium.com>
  • Loading branch information
Nadiya authored and Shuotian Cheng committed Jan 13, 2017
1 parent 3873996 commit ae4b72e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/cavium/cavm_platform_modules.mk
Original file line number Diff line number Diff line change
@@ -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)

6 changes: 6 additions & 0 deletions platform/cavium/cavm_platform_modules/DEBIAN/changelog
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions platform/cavium/cavm_platform_modules/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions platform/cavium/cavm_platform_modules/Makefile
Original file line number Diff line number Diff line change
@@ -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)

1 change: 1 addition & 0 deletions platform/cavium/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae4b72e

Please sign in to comment.