-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
223 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Linux latest kernel module test | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
specific: | ||
name: With ${{ matrix.version }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
KSER: ${{ matrix.series }} | ||
KVER: ${{ matrix.version }} | ||
CC: ${{ matrix.cc }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: Ubuntu Latest - Series Latest | ||
os: ubuntu-latest | ||
series: latest | ||
version: latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Info | ||
run: | | ||
gcc --version | ||
- name: Deps | ||
run: | | ||
sudo apt-get update | ||
# linux-headers-* only to pull in kbuild deps | ||
sudo apt-get -y install linux-headers-`uname -r` kmod libelf-dev | ||
[ "${{ matrix.cc }}" != "gcc-4.8" ] || sudo apt-get -y install gcc-4.8 | ||
- name: Setup Linux | ||
run: | | ||
install -d kernel | ||
if [ "$KSER" == "latest" ]; then | ||
KSER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/ | grep -o 'v[0-9]\+\.[0-9a-zA-Z]\+/' | sed 's/\/\s*//' | sort -t. -k2,2V -k3,3V -k4,4V | tail -n 1 | sed 's/v//') | ||
fi | ||
if [ "$KVER" == "latest" ]; then | ||
KVER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/v$KSER/ | grep -o 'linux-[0-9]\+\.[0-9]\+\.[0-9]\+\.tar\.xz' | sort -t- -k2,2n -k3,3n -k4,4n | tail -n 1 | sed 's/linux-\(.*\)\.tar\.xz/\1/') | ||
fi | ||
echo "https://cdn.kernel.org/pub/linux/kernel/v$KSER/linux-$KVER.tar.xz" | ||
curl -s https://cdn.kernel.org/pub/linux/kernel/v$KSER/linux-$KVER.tar.xz | tar -C kernel --strip-components=1 -xJ | ||
make -C kernel CC=${CC:=gcc} defconfig | ||
make -C kernel CC=${CC:=gcc} modules_prepare | ||
- name: Build | ||
run: | | ||
make -C mrmShared/linux CC=${CC:=gcc} KERNELDIR="$PWD/kernel" |
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,8 @@ | ||
# Version definition for driver | ||
# 20240124 Release | ||
DRV_VERSION := 3 | ||
|
||
# Package control vars | ||
PKG_NAME := mrfioc2-dkms | ||
DRV_NAME := mrf | ||
DRV_GROUP := mrf |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
KERNELDIR ?= /lib/modules/$(shell uname -r)/build | ||
|
||
include VERSION | ||
include CONFIG | ||
|
||
all: modules | ||
|
||
|
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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,2 @@ | ||
# UDEV rule giving access to MRF device | ||
KERNEL=="uio*", ATTR{name}=="mrf-pci", GROUP="@@DRV_GROUP@@", MODE="0660", RUN+="/bin/chmod g+rw %S%p/resource0 && /bin/logger UDEV rule giving access to MRF device %S%p" |
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,3 @@ | ||
|
||
RPM_RELEASE := 1 | ||
# NOTE: Not necessary DIST ?= el7 |
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
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
mrmShared/linux/dkms/dkms.conf.in → mrmShared/linux/dkms-rpm/dkms.conf.in
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
DESCRIPTION="DKMS mrfioc2 kernel module." | ||
PACKAGE_NAME="@@DRV_NAME@@" | ||
PACKAGE_VERSION="@@RPM_VERSION@@" | ||
BUILT_MODULE_NAME[0]="@@DRV_NAME@@" | ||
DEST_MODULE_LOCATION[0]="/extra" | ||
MAKE[0]="make -j1 KERNEL_DIR=$kernel_source_dir VERSION=@@DRV_VERSION@@" | ||
MAKE[0]="make -j1 KERNEL_DIR=$kernel_source_dir VERSION=@@DRV_VERSION@@ DRV_VERSION=@@DRV_VERSION@@" | ||
AUTOINSTALL=YES | ||
REMAKE_INITRD=NO |
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,86 @@ | ||
%define kmod_name @@DRV_NAME@@ | ||
%define udev_rules_update \ | ||
/sbin/udevadm control --reload-rules && \ | ||
/sbin/udevadm trigger | ||
|
||
Summary: DKMS mrfioc2 kernel module | ||
|
||
Name: @@PKG_NAME@@ | ||
Version: @@RPM_VERSION@@ | ||
Release: @@RPM_RELEASE@@ | ||
|
||
Vendor: EPICS Community | ||
License: EPICS Open License | ||
Group: System Environment/Kernel | ||
URL: https://github.com/epics-modules/mrfioc2 | ||
BuildRequires: autoconf libtool gcc gcc-c++ | ||
BuildArch: @@ARCH@@ | ||
Requires: dkms | ||
Requires: udev | ||
BuildRoot: %{_tmppath}/%{kmod_name}-%{version}-root | ||
|
||
# The two target directories | ||
%define dkmsdir /usr/src/%{kmod_name}-%{version} | ||
%define udevdir /etc/udev/rules.d | ||
|
||
%description | ||
Installs the kernel driver for interfacing to the MRF timing cards over | ||
PCI express. The driver is installed using dkms. | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
||
%install | ||
rm -rf %{buildroot} | ||
mkdir -p %{buildroot}%{dkmsdir} %{buildroot}%{udevdir} | ||
install -m 0644 %{_sourcedir}/uio_mrf.c %{buildroot}%{dkmsdir} | ||
install -m 0644 %{_sourcedir}/jtag_mrf.c %{buildroot}%{dkmsdir} | ||
install -m 0644 %{_sourcedir}/mrf.h %{buildroot}%{dkmsdir} | ||
install -m 0644 %{_curdir}/Makefile.dkms %{buildroot}%{dkmsdir}/Makefile | ||
install -m 0644 %{_sourcedir}/Kbuild %{buildroot}%{dkmsdir} | ||
install -m 0644 %{_curdir}/dkms.conf %{buildroot}%{dkmsdir} | ||
install -m 0644 %{_curdir}/50-mrf.rules %{buildroot}%{udevdir} | ||
|
||
%files | ||
%{dkmsdir}/uio_mrf.c | ||
%{dkmsdir}/jtag_mrf.c | ||
%{dkmsdir}/mrf.h | ||
%{dkmsdir}/Makefile | ||
%{dkmsdir}/Kbuild | ||
%{dkmsdir}/dkms.conf | ||
%{udevdir}/50-mrf.rules | ||
|
||
%post | ||
# PRP: groupadd -r @@DRV_GROUP@@ 2>&1 || : | ||
dkms add -m %{kmod_name} -v %{version} --rpm_safe_upgrade | ||
dkms build -m %{kmod_name} -v %{version} | ||
dkms install -m %{kmod_name} -v %{version} | ||
modprobe %{kmod_name} | ||
%udev_rules_update | ||
|
||
%preun | ||
modprobe -r %{kmod_name} | ||
dkms remove --all -m %{kmod_name} -v %{version} --rpm_safe_upgrade --all ||: | ||
%udev_rules_update | ||
# PRP: group root groupdel @@DRV_GROUP@@ 2>&1 || : | ||
|
||
%postun | ||
rmdir /usr/src/%{kmod_name}-%{version} | ||
|
||
%changelog | ||
|
||
* Wed Jan 24 2024 Jerzy Jamroz <jerzy.jamroz@gmail.com> - 3-1 | ||
- Build adjustments exposing the control variables. | ||
- Pkg name changed to mrfioc2-dkms. | ||
- Correction of the driver version handling. | ||
- Group rw access for the pci resource0. | ||
- AER handling functions. | ||
- Device access group added. | ||
- Tested on CentOS7. | ||
|
||
* Mon Jan 22 2024 Jerzy Jamroz <jerzy.jamroz@gmail.com> - 2-1 | ||
- Version 2 skipped due to usage as version 1. | ||
- Tested on CentOS7. | ||
|
||
* Mon Dec 14 2020 Michael Abbott <michael.abbott@diamond.ac.uk> - 1-1 | ||
- Initial release. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.