Skip to content

Commit ae4b72e

Browse files
NadiyaShuotian Cheng
Nadiya
authored and
Shuotian Cheng
committed
[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 <[email protected]>
1 parent 3873996 commit ae4b72e

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CAVM_PLATFORM_DEB = cavm_platform_modules.deb
2+
$(CAVM_PLATFORM_DEB)_SRC_PATH = $(PLATFORM_PATH)/cavm_platform_modules
3+
SONIC_MAKE_DEBS += $(CAVM_PLATFORM_DEB)
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
cavm-platform-modules (1.0) unstable; urgency=low
3+
4+
* Initial release
5+
6+
-- [email protected] Thu, 12 Jan 2017 19:24:41 +0200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Package: cavm-platform-modules
2+
Version: 1.0
3+
Architecture: amd64
4+
Depends: linux-image-3.16.0-4-amd64
5+
Maintainer: [email protected]
6+
Description: kernel modules for platform devices such as fan, led, sfp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.ONESHELL:
2+
SHELL = /bin/bash
3+
.SHELLFLAGS += -e
4+
5+
MAIN_TARGET = cavm_platform_modules.deb
6+
DEB_BUILD_DIR = cavm-platform-modules-deb
7+
8+
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
9+
# get sources
10+
rm -rf SONiC
11+
git clone https://github.com/edge-core/SONiC.git
12+
13+
# build
14+
pushd SONiC/AS7512-32X/module/
15+
16+
KERNEL_SRC=/lib/modules/$(KVERSION)/build make
17+
popd
18+
mkdir -p $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
19+
20+
cp SONiC/AS7512-32X/module/*.ko $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
21+
cp -r DEBIAN $(DEB_BUILD_DIR)
22+
dpkg-deb -b $(DEB_BUILD_DIR) $(MAIN_TARGET)
23+
24+
mv $(MAIN_TARGET) $(DEST)/
25+
rm -rf $(DEB_BUILD_DIR)
26+

platform/cavium/rules.mk

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include $(PLATFORM_GENERIC_PATH)/rules.mk
33
include $(PLATFORM_PATH)/cavm-sai.mk
44
include $(PLATFORM_PATH)/docker-syncd-cavm.mk
55
include $(PLATFORM_PATH)/docker-orchagent-cavm.mk
6+
include $(PLATFORM_PATH)/cavm_platform_modules.mk
67

78
SONIC_ALL += $(DOCKER_SYNCD_CAVM) \
89
$(DOCKER_ORCHAGENT_CAVM)

0 commit comments

Comments
 (0)