-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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) | ||
|
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-3.16.36 | ||
Maintainer: Nadiya.Stetskovych@cavium.com | ||
Description: kernel modules for platform devices such as fan, led, sfp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
.SHELLFLAGS += -e | ||
|
||
MAIN_TARGET = cavm_platform_modules.deb | ||
DEB_BUILD_DIR = cavm-platform-modules-deb | ||
KVERSION = linux-3.16.36 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why different version from what SONiC uses (3.16.04)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SONiC already use 3.16.36 |
||
|
||
$(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=/sonic/src/sonic-linux-kernel/$(KVERSION)/debian/build/build_amd64_none_amd64 make | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that using a path in sources is a good idea There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can not built any modules before kernel :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, we can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understated final image (sonic-generic.bin) will have 3.16.36. So built modules for kernel where it will be inserted. Correct if I am wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we install the linux-headers-3.16.0-4-amd64_3.16.36-1+deb8u2_amd64.deb and linux-headers-3.16.0-4-common_3.16.36-1+deb8u2_amd64.deb we have built first? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NStetskovych Kernel release version is unchanged 3.16.0-4-amd64 and should be used for cross-compilation without caring about distro versions. @lguohan I already wanted to install them, but I didn't find any difference between headers provided by those two distro versions and what we have now. Anyway, it will be better to install them to ensure we won't miss anything in the future. There's going to be a separate PR with headers integrated and variables for distro version and subversion to avoid duplication as it is done for other targets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marian-pritsak I can change, but I do not understand how I will build modules for 3.16.0-4 but insert for 3.16.36? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Every version of linux ships linux-headers that can be installed for modules compilation (linux-headers-3.16.0-4-amd64_3.16.36-1+deb8u2_amd64.deb and linux-headers-3.16.0-4-common_3.16.36-1+deb8u2_amd64.deb for current linux version). These .deb packages contain headers and Makefiles needed in order to compile external modules and are always installed into /lib/modules/linux-headers-$(uname -r)/. So to compile modules KERNEL_SRC is always equal to /lib/modules/$(KVERSION)/build and KVERSION is always equal to kernel release (3.16.0-4-amd64 in our case). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
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) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Package: cavm-platform-modules | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are two copies of same file provided? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my fault, will remove. thanks. |
||
Version: 1.0 | ||
Architecture: amd64 | ||
Depends: linux-3.16.36 | ||
Maintainer: n@gmail.com | ||
Description: kernel modules for platform devices such as fan, led, sfp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be this one. Depends: linux-image-3.16.0-4-amd64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to add changelog into the deb package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks.