cmake project now accepts SPC_SOURCE environment variable to build MI40xx binary kernel driver

This commit is contained in:
Markus Rosenstihl 2017-01-26 16:56:17 +00:00
parent 9836f0b073
commit 4a308c6ddf
14 changed files with 69 additions and 40 deletions

7
debian/changelog vendored
View File

@ -1,11 +1,12 @@
damaris (0.16~svn803) unstable; urgency=low
damaris (0.16+nmu803) unstable; urgency=low
* transition to cmake and new debhelper
* Fixed: pulseblaster WAIT opcode is ignored if preceeding state is shorter than 120ns.
* Fixed: pulseblaster WAIT opcode is ignored if
preceding state is shorter than 120ns.
* pulseblaster_only backend
* preliminary AD5791 driver
-- Markus Rosenstihl <markusro@track.fkp.physik.tu-darmstadt.de> Wed, 25 Jan 2017 17:35:05 +0100
-- Markus Rosenstihl <markus.rosenstihl@physik.tu-darmstadt.de> Wed, 25 Jan 2017 17:35:05 +0100
damaris (0.15) UNRELEASED; urgency=low

2
debian/compat vendored
View File

@ -1 +1 @@
9
7

14
debian/control vendored
View File

@ -3,28 +3,30 @@ Section: science
Priority: optional
Standards-Version: 3.9.6
Maintainer: Markus Rosenstihl <Markus.Rosenstihl@physik.tu-darmstadt.de>
Uploaders: Markus Rosenstihl <Markus.Rosenstihl@physik.tu-darmstadt.de>
Build-Depends: debhelper,
Build-Depends: debhelper (>=7),
libxerces-c3-dev|libxerces-c-dev,
libexpat-dev|libexpat1-dev,
unzip,
libglib2.0-dev,
linux-headers|linux-headers-amd64,
cmake,
kmod
Package: damaris-backends
Architecture: i386 amd64
Depends: ${shlibs:Depends}, bash (>=4.2), kmod, coreutils (>=8.13), libxerces-c3.1|libxerces-c-dev, udev, libglib2.0-0
Depends: ${misc:Depends},${shlibs:Depends}, bash (>=4.2), kmod, coreutils (>=8.13), libxerces-c3.1|libxerces-c-dev, udev, libglib2.0-0
Recommends: python-damaris|damaris-frontend, damaris-modules
Description: DAMARIS backends package
This is the DAMARIS backends package. It contains machine definitions (the backends) for running DAMARIS experiments.
This is the DAMARIS backends package. It contains machine definitions
(the backends) for running DAMARIS experiments.
Package: damaris-modules
Architecture: i386 amd64
Recommends: damaris-backends
Depends: ${linux-image:Depends}
Depends: ${misc:Depends}, kmod
Replaces: damaris-backends (<= 0.13-0.5)
Description: Kernel modules for DAMARIS hardware
This are kernel modules for DAMARIS compatible hardware. Currently there are two binary drivers:
This are kernel modules for DAMARIS compatible hardware.
Currently there are two binary drivers:
one for SpinCore PulseBlaster and Spectrum MI40xx ADC cards.

View File

@ -18,6 +18,7 @@ dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime

View File

@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/sh -e
if grep nmr /etc/group >/dev/null; then
echo "group nmr already exists" ;
@ -13,15 +13,3 @@ find /usr/lib/damaris/backends -type f \
-exec chmod u+s,o= {} \;
#DEBHELPER#
if [ "$1" = "configure" -a -n "$2" ]; then
comparableversion=`echo "$2"|sed 's/[\.-]/ /g'|xargs printf "%03d%03d%03d"`
if [ "000011000" -gt $comparableversion ]; then
# transition to version with udev
if [ \! -e /etc/udev/rules.d/z60_damaris-backends.rules ]; then
# check whether the link/script was done when updating from 0.11 to newer version
ln -s ../damaris-backends.rules /etc/udev/rules.d/z60_damaris-backends.rules
fi
fi
fi

View File

@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/sh -e
if test x$1 = xpurge; then
if grep nmr /etc/group >/dev/null; then

View File

@ -18,6 +18,7 @@ dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime

View File

@ -1,8 +1,8 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: damaris-backends
# Required-Start: $syslog
# Required-Stop: $syslog
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Startup script to load nmr hardware drivers for use with damaris backends
@ -137,6 +137,7 @@ status () {
fi
}
case "$1" in
start)
start
@ -148,6 +149,10 @@ case "$1" in
stop
start
;;
force-reload)
stop
start
;;
status)
status
;;

View File

@ -1,8 +1,8 @@
#! /bin/sh
#! /bin/sh -e
if grep -q nmr /etc/group; then
#DEBHELPER#
echo "group nmr already exists" ;
else
echo "creating group nmr" ;
groupadd nmr || echo "failed!"
fi

4
debian/files vendored
View File

@ -1,2 +1,2 @@
damaris-backends_0.16~svn803_amd64.deb science optional
damaris-modules_0.16~svn803_amd64.deb science optional
damaris-backends_0.16+nmu803_amd64.deb science optional
damaris-modules_0.16+nmu803_amd64.deb science optional

24
debian/rules vendored
View File

@ -2,13 +2,27 @@
# Achim Gaedke
# May 2007
# Uncomment this to turn on verbose mode.
DH_VERBOSE=1
export DH_OPTIONS=-v
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
#
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
#
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DH_OPTIONS=-v
BACKENDSBASE=$(shell pwd)/debian/damaris-backends
BACKENDSMACHINES = \

2
debian/source/lintian-overrides vendored Normal file
View File

@ -0,0 +1,2 @@
damaris source: source-is-missing drivers/SpinCore-PulseBlaster/pulseblaster.ko
damaris source: source-is-missing drivers/Spectrum-MI40xxSeries/linux/src_all/micx_drv/spc_smp.ko

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
# unpack headers needed
set( SPC_DRV drv_header_v402b6844.zip)
set(SPC_DRV drv_header_v402b6844.zip)
set(SPC_HEADERS
include/spcerr.h
include/regs.h
@ -21,7 +21,13 @@ add_custom_command(OUTPUT ${SPC_HEADERS}
# the actual kernel source file is in the src_all/micx_drv subfolder
# If the "linux" folder exists the driver will be build
set(SPC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/linux/src_all/micx_drv)
if(DEFINED ENV{SPC_SOURCE})
message("SPC_SOURCE environment variable set")
set(SPC_SRC $ENV{SPC_SOURCE})
else()
message("Spectrum driver source path not defined in envirnoment variable SPC_SOURCE")
set(SPC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/linux/src_all/micx_drv)
endif()
set(DRIVER_FILE ${SPC_SRC}/spc_smp.ko )
set(KERNEL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" )
set(KBUILD_CMD ${CMAKE_MAKE_PROGRAM}

View File

@ -1,8 +1,8 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: damaris-backends
# Required-Start: $syslog
# Required-Stop: $syslog
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Startup script to load nmr hardware drivers for use with damaris backends
@ -136,6 +136,12 @@ status () {
fi
}
force-reload() {
stop
start
}
case "$1" in
start)
start
@ -150,8 +156,11 @@ case "$1" in
status)
status
;;
force-reload)
force-reload
;;
*)
printf "Usage: %s {start|stop|restart|status}\n" "$0"
printf "Usage: %s {start|stop|restart|force-reload|status}\n" "$0"
RETVAL=1
esac
exit $RETVAL