-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux/efa: Add spec file for EFA kernel driver
Add a spec file to package the EFA kernel driver source and install it using dkms. This is so we can install the driver in an environment where we do not control the kernel installation. We should add another spec file to build the kernel driver and package it when we package the driver with the kernel. Signed-off-by: Robert Wespetal <[email protected]> Signed-off-by: Gal Pressman <[email protected]>
- Loading branch information
1 parent
173bbc5
commit 0328a70
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PACKAGE_NAME="efa" | ||
PACKAGE_VERSION="0.9.0" | ||
CLEAN="make clean" | ||
MAKE="make KERNEL_VERSION=${kernelver}" | ||
BUILT_MODULE_NAME[0]="efa" | ||
BUILT_MODULE_LOCATION="" | ||
DEST_MODULE_LOCATION="/extra" | ||
DEST_MODULE_NAME[0]="efa" | ||
AUTOINSTALL="yes" | ||
NO_WEAK_MODULES="yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# /etc/modules-load.d/efa.conf | ||
ib_core | ||
ib_uverbs | ||
efa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Makefile for creating rpm of the Amazon EFA driver | ||
|
||
NAME = efa | ||
VERSION = 0.9.0 | ||
|
||
TOPDIR := $(shell git rev-parse --show-toplevel) | ||
TAG = master | ||
TARBALL = $(NAME)-$(VERSION).tar | ||
|
||
RPMDEFS = --define '_topdir %(pwd)' \ | ||
--define '_ntopdir %(pwd)' \ | ||
--define '_builddir %{_ntopdir}/build' \ | ||
--define '_buildrootdir %{_builddir}' \ | ||
--define '_sourcedir %{_ntopdir}' \ | ||
--define '_specdir %{_ntopdir}' \ | ||
--define '_rpmdir %{_ntopdir}' \ | ||
--define '_srcrpmdir %{_ntopdir}' \ | ||
--define "driver_version $(VERSION)" | ||
|
||
all : rpm | ||
|
||
tarball : $(TARBALL) | ||
$(TARBALL) : always | ||
(cd $(TOPDIR) && \ | ||
git archive --format=tar --prefix=$(NAME)-$(VERSION)/ $(TAG) \ | ||
kernel/linux/efa/) > $@ | ||
|
||
srpm : $(TARBALL) Makefile | ||
rpmbuild -bs $(RPMDEFS) efa.spec | ||
|
||
rpm : $(TARBALL) Makefile | ||
rpmbuild -ba $(RPMDEFS) efa.spec | ||
|
||
clean : | ||
rm -f $(TARBALL) *.src.rpm | ||
|
||
always: | ||
|
||
.PHONY : srpm clean always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
%define name efa | ||
%define debug_package %{nil} | ||
|
||
Name: %{name} | ||
Version: %{driver_version} | ||
Release: 1%{?dist} | ||
Summary: %{name} kernel module | ||
|
||
Group: System/Kernel | ||
License: Dual BSD/GPL | ||
URL: https://github.com/amzn/amzn-drivers/ | ||
Source0: %{name}-%{version}.tar | ||
|
||
Requires: dkms %kernel_module_package_buildreqs | ||
|
||
%define install_path /usr/src/%{name}-%{version} | ||
|
||
%description | ||
%{name} kernel module source and DKMS scripts to build the kernel module. | ||
|
||
%prep | ||
%setup -n %{name}-%{version} -q | ||
|
||
%post | ||
dkms add -m %{name} -v %{driver_version} | ||
dkms build -m %{name} -v %{driver_version} | ||
dkms install -m %{name} -v %{driver_version} | ||
|
||
%preun | ||
dkms remove -m %{name} -v %{driver_version} --all | ||
|
||
%build | ||
|
||
%install | ||
cd kernel/linux/efa | ||
mkdir -p %{buildroot}%{install_path} | ||
install -D -m 644 conf/efa.conf %{buildroot}/etc/modules-load.d/efa.conf | ||
install -m 644 conf/dkms.conf %{buildroot}%{install_path} | ||
install -m 644 efa_com.c %{buildroot}%{install_path} | ||
install -m 644 efa_com_cmd.c %{buildroot}%{install_path} | ||
install -m 644 efa_main.c %{buildroot}%{install_path} | ||
install -m 644 efa_sysfs.c %{buildroot}%{install_path} | ||
install -m 644 efa_verbs.c %{buildroot}%{install_path} | ||
install -m 644 efa-abi.h %{buildroot}%{install_path} | ||
install -m 644 efa_admin_cmds_defs.h %{buildroot}%{install_path} | ||
install -m 644 efa_admin_defs.h %{buildroot}%{install_path} | ||
install -m 644 efa_com_cmd.h %{buildroot}%{install_path} | ||
install -m 644 efa_com.h %{buildroot}%{install_path} | ||
install -m 644 efa_common_defs.h %{buildroot}%{install_path} | ||
install -m 644 efa.h %{buildroot}%{install_path} | ||
install -m 644 efa_regs_defs.h %{buildroot}%{install_path} | ||
install -m 644 efa_sysfs.h %{buildroot}%{install_path} | ||
install -m 644 kcompat.h %{buildroot}%{install_path} | ||
install -m 644 Makefile %{buildroot}%{install_path} | ||
install -m 644 README %{buildroot}%{install_path} | ||
install -m 644 RELEASENOTES.md %{buildroot}%{install_path} | ||
|
||
%files | ||
%{install_path} | ||
/etc/modules-load.d/efa.conf | ||
|
||
%changelog | ||
* Fri Mar 8 2019 Robert Wespetal <[email protected]> - 0.9.0 | ||
- initial build for RHEL |