From 4a308c6ddfad054c00f44984e6eefa3f4b95af86 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Thu, 26 Jan 2017 16:56:17 +0000 Subject: [PATCH] cmake project now accepts SPC_SOURCE environment variable to build MI40xx binary kernel driver --- debian/changelog | 7 +++--- debian/compat | 2 +- debian/control | 14 +++++++----- debian/damaris-backends.debhelper.log | 1 + debian/damaris-backends.postinst | 14 +----------- debian/damaris-backends.postrm | 2 +- debian/damaris-modules.debhelper.log | 1 + debian/damaris-modules.init | 9 ++++++-- debian/damaris-modules.postinst | 4 ++-- debian/files | 4 ++-- debian/rules | 24 ++++++++++++++++---- debian/source/lintian-overrides | 2 ++ drivers/Spectrum-MI40xxSeries/CMakeLists.txt | 10 ++++++-- tools/nmr_drivers.sh | 15 +++++++++--- 14 files changed, 69 insertions(+), 40 deletions(-) create mode 100644 debian/source/lintian-overrides diff --git a/debian/changelog b/debian/changelog index 04c65c1..0870db8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 25 Jan 2017 17:35:05 +0100 + -- Markus Rosenstihl Wed, 25 Jan 2017 17:35:05 +0100 damaris (0.15) UNRELEASED; urgency=low diff --git a/debian/compat b/debian/compat index ec63514..7f8f011 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +7 diff --git a/debian/control b/debian/control index 58219de..cc73f70 100644 --- a/debian/control +++ b/debian/control @@ -3,28 +3,30 @@ Section: science Priority: optional Standards-Version: 3.9.6 Maintainer: Markus Rosenstihl -Uploaders: Markus Rosenstihl -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. diff --git a/debian/damaris-backends.debhelper.log b/debian/damaris-backends.debhelper.log index 34a1de4..57d3323 100644 --- a/debian/damaris-backends.debhelper.log +++ b/debian/damaris-backends.debhelper.log @@ -18,6 +18,7 @@ dh_installdebconf dh_installemacsen dh_installifupdown dh_installinfo +dh_pysupport dh_installinit dh_installmenu dh_installmime diff --git a/debian/damaris-backends.postinst b/debian/damaris-backends.postinst index ba38f29..af6fa23 100755 --- a/debian/damaris-backends.postinst +++ b/debian/damaris-backends.postinst @@ -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 - diff --git a/debian/damaris-backends.postrm b/debian/damaris-backends.postrm index c6df39b..4ff2cbc 100755 --- a/debian/damaris-backends.postrm +++ b/debian/damaris-backends.postrm @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/sh -e if test x$1 = xpurge; then if grep nmr /etc/group >/dev/null; then diff --git a/debian/damaris-modules.debhelper.log b/debian/damaris-modules.debhelper.log index 34a1de4..57d3323 100644 --- a/debian/damaris-modules.debhelper.log +++ b/debian/damaris-modules.debhelper.log @@ -18,6 +18,7 @@ dh_installdebconf dh_installemacsen dh_installifupdown dh_installinfo +dh_pysupport dh_installinit dh_installmenu dh_installmime diff --git a/debian/damaris-modules.init b/debian/damaris-modules.init index 000560a..f5aa7e5 100755 --- a/debian/damaris-modules.init +++ b/debian/damaris-modules.init @@ -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 ;; diff --git a/debian/damaris-modules.postinst b/debian/damaris-modules.postinst index 213910e..d59b495 100755 --- a/debian/damaris-modules.postinst +++ b/debian/damaris-modules.postinst @@ -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 - diff --git a/debian/files b/debian/files index f6d1a3c..bd27202 100644 --- a/debian/files +++ b/debian/files @@ -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 diff --git a/debian/rules b/debian/rules index 40a3f4b..e872810 100755 --- a/debian/rules +++ b/debian/rules @@ -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 = \ diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 0000000..16498d0 --- /dev/null +++ b/debian/source/lintian-overrides @@ -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 diff --git a/drivers/Spectrum-MI40xxSeries/CMakeLists.txt b/drivers/Spectrum-MI40xxSeries/CMakeLists.txt index 2f4610e..cc76dac 100644 --- a/drivers/Spectrum-MI40xxSeries/CMakeLists.txt +++ b/drivers/Spectrum-MI40xxSeries/CMakeLists.txt @@ -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} diff --git a/tools/nmr_drivers.sh b/tools/nmr_drivers.sh index dd4a38f..674e25f 100755 --- a/tools/nmr_drivers.sh +++ b/tools/nmr_drivers.sh @@ -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