Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rules to build cavium platform modules #186

Merged
merged 4 commits into from
Jan 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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