add debian package generator definition
authorMiroslav Ondra <ondra@faster.cz>
Fri, 21 Sep 2018 00:44:18 +0000 (02:44 +0200)
committerMiroslav Ondra <ondra@faster.cz>
Fri, 21 Sep 2018 00:44:18 +0000 (02:44 +0200)
23 files changed:
Makefile
debian/README [new file with mode: 0644]
debian/autoscripts/postinst-modules [new file with mode: 0644]
debian/autoscripts/postrm-modules [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/clean [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/neuron-kernel-docs.docs [new file with mode: 0644]
debian/neuron-kernel.changelog [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
debian/unipi-kernel-modules-dkms.dkms [new file with mode: 0644]
debian/unipi-kernel-modules-dkms.install.in [new file with mode: 0644]
misc/check-raspbian [new file with mode: 0755]
misc/current [new file with mode: 0755]
misc/raspbian [changed mode: 0644->0755]
modules/unipi/Makefile
modules/unipi/bin/.dummy [deleted file]
modules/unipi/current [deleted file]
modules/unipi/raspbian [deleted file]
modules/unipi/src/unipi_common.h

index 97ee5271576ebd37f6ab5c06e1336e2dd4bfee7c..e638735c6b9070bd2a1f739fc85cdf5c40486d16 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,11 @@ all:
                cd ${MODULES_DIR_PATH}$$m; make all;\
                done
 
+install: 
+       for m in ${MODULES_LIST}; do\
+               cd ${MODULES_DIR_PATH}$$m; make modules_install INSTALL_MOD_PATH=${DESTDIR};\
+               done
+
 clean: 
        for m in ${MODULES_LIST}; do\
                cd ${MODULES_DIR_PATH}$$m; make clean;\
diff --git a/debian/README b/debian/README
new file mode 100644 (file)
index 0000000..2e30799
--- /dev/null
@@ -0,0 +1,6 @@
+The Debian Package unipi-kernel-modules
+----------------------------
+
+Comments regarding the Package
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 11 Apr 2018 10:14:19 +0200
diff --git a/debian/autoscripts/postinst-modules b/debian/autoscripts/postinst-modules
new file mode 100644 (file)
index 0000000..a31f562
--- /dev/null
@@ -0,0 +1,3 @@
+if [ "$1" = "configure" ]; then
+               depmod -a #KVERS# || true
+fi
diff --git a/debian/autoscripts/postrm-modules b/debian/autoscripts/postrm-modules
new file mode 100644 (file)
index 0000000..b2b10fb
--- /dev/null
@@ -0,0 +1 @@
+       depmod -a #KVERS# || true
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..c61d781
--- /dev/null
@@ -0,0 +1,68 @@
+unipi-kernel-modules (1.16) unstable; urgency=medium
+
+  * changed from binary to dkms version
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 21 Sep 2018 01:03:41 +0200
+
+neuron-kernel (1.15.20180914) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.69-v7+ (=1.20180910-1)
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 14 Sep 2018 16:35:36 +0200
+
+neuron-kernel (1.15.20180907) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.62-v7+ (=1.20180817-1)
+  * fixed spi buffer alignement
+  * redesigned uart rx/tx proc
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 14 Sep 2018 00:47:53 +0200
+
+neuron-kernel (1.14.20180803) unstable; urgency=medium
+
+  * fixed trace_printk for debugging
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 03 Aug 2018 12:42:40 +0200
+
+neuron-kernel (1.14.20180802) unstable; urgency=medium
+
+  * redesigned line discipline
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Thu, 02 Aug 2018 21:37:29 +0200
+
+neuron-kernel (1.13.20180719) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.52-v7+ (=1.20180703-1)
+  * changed char dev name to /dev/unipispi
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Thu, 02 Aug 2018 21:36:09 +0200
+
+neuron-kernel (1.12.14062018-0) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.52-v7+ (=1.20180703-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 16 Jul 2018 10:00:19 +0200
+
+neuron-kernel (1.11.06062018-0) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 06 Jun 2018 20:16:19 +0200
+
+neuron-kernel (0.03082018-3) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 18 Apr 2018 21:49:19 +0200
+
+neuron-kernel (0.03082018-2) unstable; urgency=medium
+
+  * Compiled for new distribution kernel (=1.20180328-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 17 Apr 2018 10:14:19 +0200
+
+neuron-kernel (0.03082018) unstable; urgency=medium
+
+  * Initial Release.
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 11 Apr 2018 10:14:19 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644 (file)
index 0000000..46d5c03
--- /dev/null
@@ -0,0 +1,5 @@
+debian/neuron-kernel.install
+debian/unipi-kernel-modules-dkms.install
+debian/neuron-kernel.substvars
+debian/neuron-kernel.postinst.debhelper 
+debian/neuron-kernel.postrm.debhelper
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..886fa1a
--- /dev/null
@@ -0,0 +1,26 @@
+Source: unipi-kernel-modules
+Section: kernel
+Priority: optional
+Maintainer: Miroslav Ondra <info@unipi.technology>
+Build-Depends: debhelper (>= 9)
+Standards-Version: 3.9.8
+Homepage: <insert the upstream URL, if relevant>
+#Vcs-Git: https://anonscm.debian.org/collab-maint/neuron-kernel.git
+
+Package: neuron-kernel
+Architecture: armhf
+Depends: ${misc:Depends}, unipi-common, raspberrypi-kernel(=${RPI-FIRMWARE-VER})
+Description: UniPi Neuron kernel modules
+ Binary kernel modules for UniPi Neuron controller. Compiled with
+ raspberrypi-kernel from Raspbian distribution. 
+
+Package: unipi-kernel-modules-dkms
+Architecture: linux-any
+Depends: ${misc:Depends}, unipi-common, dkms
+Replaces: neuron-kernel
+Conflicts: neuron-kernel
+Description: UniPi Neuron kernel modules - DKMS source
+ This package contains source code of kernel module for spi protocol 
+ used by internal boards in the UniPi Neuron/Axon controllers.
+ Can be used with DKMS so that local kernel images are automatically
+ built and installed every time relevant kernel packages are upgraded.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..9a7edec
--- /dev/null
@@ -0,0 +1,33 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: unipi-kernel-modules
+Source: <url://example.com>
+
+Files: *
+Copyright: 2018 UniPi Technology <info@unipi.technology>
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2018 Miroslav Ondra <info@unipi.technology>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid picking licenses with terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
diff --git a/debian/neuron-kernel-docs.docs b/debian/neuron-kernel-docs.docs
new file mode 100644 (file)
index 0000000..5874bfe
--- /dev/null
@@ -0,0 +1,3 @@
+README
+README.Debian
+README.source
diff --git a/debian/neuron-kernel.changelog b/debian/neuron-kernel.changelog
new file mode 100644 (file)
index 0000000..f5a5e36
--- /dev/null
@@ -0,0 +1,74 @@
+unipi-kernel-modules (1.16.1.20180919-1) unstable; urgency=medium
+
+  * Compiled for raspberrypi-kernel 1.20180919-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 21 Sep 2018 02:36:55 +0200
+
+unipi-kernel-modules (1.16) unstable; urgency=medium
+
+  * changed from binary to dkms version
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 21 Sep 2018 01:03:41 +0200
+
+neuron-kernel (1.15.20180914) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.69-v7+ (=1.20180910-1)
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 14 Sep 2018 16:35:36 +0200
+
+neuron-kernel (1.15.20180907) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.62-v7+ (=1.20180817-1)
+  * fixed spi buffer alignement
+  * redesigned uart rx/tx proc
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 14 Sep 2018 00:47:53 +0200
+
+neuron-kernel (1.14.20180803) unstable; urgency=medium
+
+  * fixed trace_printk for debugging
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Fri, 03 Aug 2018 12:42:40 +0200
+
+neuron-kernel (1.14.20180802) unstable; urgency=medium
+
+  * redesigned line discipline
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Thu, 02 Aug 2018 21:37:29 +0200
+
+neuron-kernel (1.13.20180719) unstable; urgency=medium
+
+  * Compiled for kernel 4.14.52-v7+ (=1.20180703-1)
+  * changed char dev name to /dev/unipispi
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz>  Thu, 02 Aug 2018 21:36:09 +0200
+
+neuron-kernel (1.12.14062018-0) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.52-v7+ (=1.20180703-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 16 Jul 2018 10:00:19 +0200
+
+neuron-kernel (1.11.06062018-0) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 06 Jun 2018 20:16:19 +0200
+
+neuron-kernel (0.03082018-3) unstable; urgency=medium
+
+  * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 18 Apr 2018 21:49:19 +0200
+
+neuron-kernel (0.03082018-2) unstable; urgency=medium
+
+  * Compiled for new distribution kernel (=1.20180328-1)
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 17 Apr 2018 10:14:19 +0200
+
+neuron-kernel (0.03082018) unstable; urgency=medium
+
+  * Initial Release.
+
+ -- Miroslav Ondra <info@unipi.technology>  Wed, 11 Apr 2018 10:14:19 +0200
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..3f8db1a
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+
+# 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
+
+MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
+
+.raspbian-versions:
+       misc/check-raspbian
+
+include ./.raspbian-versions
+
+DISTRIB=$(shell dpkg-parsechangelog -l debian/neuron-kernel.changelog -S Distribution)
+NEURON_KERNEL_VERSION=$(shell dpkg-parsechangelog -l debian/neuron-kernel.changelog -S Version)
+
+%:
+       dh $@ --with dkms
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+#      dh_auto_configure -- #  -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
+override_dh_installmodules:
+       DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
+
+
+override_dh_prep:
+       dh_prep --exclude=neuron-kernel.substvars 
+       echo RPI-FIRMWARE-VER=${RPI_FIRMWARE_VER} >> debian/neuron-kernel.substvars
+       sed "s/#MOD_VERSION#/$(MOD_VERSION)/g" debian/unipi-kernel-modules-dkms.install.in > debian/unipi-kernel-modules-dkms.install
+       @if echo ${NEURON_KERNEL_VERSION} | grep -qve "^$(MOD_VERSION)"; then\
+               ( sed '/^ -- /q;' debian/changelog; echo ""; cat debian/neuron-kernel.changelog )>debian/_cl;\
+               mv debian/_cl debian/neuron-kernel.changelog;\
+       fi
+       @if [ ${NEURON_KERNEL_VERSION} != $(MOD_VERSION).$(RPI_FIRMWARE_VER) ]; then\
+               dch  -mv $(MOD_VERSION).$(RPI_FIRMWARE_VER) --release-heuristic=log \
+                        -c debian/neuron-kernel.changelog "Compiled for raspberrypi-kernel ${RPI_FIRMWARE_VER}"; \
+       fi;
+       @if [ ${DISTRIB} != "UNRELEASED" ]; then dch  -rm -c debian/neuron-kernel.changelog ""; fi
+
+override_dh_dkms:
+       dh_dkms -V $(MOD_VERSION)
+
+#override_dh_build:
+
+override_dh_auto_configure:
+       misc/check-raspbian
+       misc/current
+
+override_dh_auto_build:
+       dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
+               LINUX_DIR_PATH=${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+
+override_dh_auto_install:
+       dh_auto_install --destdir=debian/neuron-kernel -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
+               LINUX_DIR_PATH=${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+
+#override_dh_gencontrol:
+#      dh_gencontrol 
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..89ae9db
--- /dev/null
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/unipi-kernel-modules-dkms.dkms b/debian/unipi-kernel-modules-dkms.dkms
new file mode 100644 (file)
index 0000000..e02b3b4
--- /dev/null
@@ -0,0 +1,10 @@
+PACKAGE_NAME="unipi"
+PACKAGE_VERSION="#MODULE_VERSION#"
+
+BUILT_MODULE_NAME[0]="unipi"
+BUILT_MODULE_LOCATION[0]=""
+DEST_MODULE_LOCATION[0]="/extra"
+AUTOINSTALL=yes
+
+MAKE[0]="make -C $kernel_source_dir M=${dkms_tree}/unipi/${module_version}/build modules"
+CLEAN="make -C ${dkms_tree}/unipi/${module_version} clean; rm -rf ${dkms_tree}/unipi/${module_version}/build/{Module.*,modules.order,OBJ.*}"
diff --git a/debian/unipi-kernel-modules-dkms.install.in b/debian/unipi-kernel-modules-dkms.install.in
new file mode 100644 (file)
index 0000000..fb99166
--- /dev/null
@@ -0,0 +1,2 @@
+modules/unipi/src      usr/src/unipi-#MOD_VERSION#
+modules/unipi/Makefile usr/src/unipi-#MOD_VERSION#
diff --git a/misc/check-raspbian b/misc/check-raspbian
new file mode 100755 (executable)
index 0000000..097ec8c
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+###############################################
+#
+# check latest raspbian kernel version, download it to directory tmp
+#
+#################################################
+
+# get latest raspbian kernel version
+wget -q http://archive.raspberrypi.org/debian/dists/stretch/main/binary-armhf/Packages.gz -O - | gunzip \
+| awk '/^Package: raspberrypi-kernel-headers[[:blank:]]*$/ { ok=1; next} /^Package: / {ok=0;} (ok!=1) {next} 
+       /^Version: / {print "RPI_FIRMWARE_VER=" $2 } 
+       /^Filename: / {print "RPI_FIRMWARE_FILE=" $2; nextfile }' > .raspbian-versions
+
+# compare with locally installed version
+if [ ! -d tmp ]; then
+       [ -f tmp ] && rm -f tmp 
+else 
+       if diff -s .raspbian-versions tmp/versions >/dev/null 2>&1; then
+               # kernel headers are loaded
+               exit 0
+       fi
+       rm -rf tmp
+fi
+mkdir tmp
+
+. .raspbian-versions
+
+# Dowload current raspbian kernel source
+# get commit number used for making this kernel version
+cd tmp
+wget https://raw.githubusercontent.com/raspberrypi/firmware/stable/extra/git_hash -O- > .git_hash
+GIT_VER=`cat .git_hash`
+       wget https://github.com/raspberrypi/linux/archive/$GIT_VER.zip -O raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+       unzip raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+       mv linux-$GIT_VER linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+       #-----------------------------------------------------------------------
+       rm raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+
+# download headers and symbols
+wget http://archive.raspberrypi.org/debian/${RPI_FIRMWARE_FILE}
+dpkg-deb -x `basename ${RPI_FIRMWARE_FILE}` h
+cd ..
+cat .raspbian-versions >tmp/versions
diff --git a/misc/current b/misc/current
new file mode 100755 (executable)
index 0000000..89d903e
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+##########################################
+##
+## compile module agains kernel tree in tmp
+##
+##########################################
+
+cd tmp
+. versions
+
+
+KERNEL_VER=`ls -1 h/lib/modules | grep '\-v7'`
+echo $KERNEL_VER
+cp h/usr/src/linux-headers-${KERNEL_VER}/.config linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+cp h/usr/src/linux-headers-${KERNEL_VER}/Module.symvers linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+cd linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+make modules_prepare CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
+cd ../..
+#make all CCPREFIX=arm-linux-gnueabi- ARCH=arm LINUX_DIR_PATH=${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
old mode 100644 (file)
new mode 100755 (executable)
index 8a99f9f..464d0dd
@@ -1,14 +1,23 @@
 #!/bin/bash
 
+###############################################
+#
+# check latest raspbian kernel version, download it to directory tmp
+# compile module 
+#################################################
+
 mkdir -p tmp
+
+# get latest raspbian kernel version
 wget -q http://archive.raspberrypi.org/debian/dists/stretch/main/binary-armhf/Packages.gz -O - | gunzip \
 | awk '/^Package: raspberrypi-kernel-headers[[:blank:]]*$/ { ok=1; next} /^Package: / {ok=0;} (ok!=1) {next} 
-/^Version: / {print "RPI_FIRMWARE_VER=" $2 } 
-/^Filename: / {print "RPI_FIRMWARE_FILE=" $2; nextfile }' > tmp/versions
+       /^Version: / {print "RPI_FIRMWARE_VER=" $2 } 
+       /^Filename: / {print "RPI_FIRMWARE_FILE=" $2; nextfile }' > tmp/versions
 
 cd tmp
 . versions
 
+# get kernel source
 #-----------------------------------------------------------------------
 # this method doesn't work if tag in git wasn't created
 #wget https://github.com/raspberrypi/linux/archive/raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
@@ -16,16 +25,20 @@ cd tmp
 
 # alternate method to get raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
 # get commit number used for making this kernel version
-wget https://raw.githubusercontent.com/raspberrypi/firmware/stable/extra/git_hash -O- > .git_hash
-GIT_VER=`cat .git_hash`
-wget https://github.com/raspberrypi/linux/archive/$GIT_VER.zip -O raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-unzip raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-mv linux-$GIT_VER linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-#-----------------------------------------------------------------------
-rm raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
 
+       wget https://raw.githubusercontent.com/raspberrypi/firmware/stable/extra/git_hash -O- > .git_hash
+       GIT_VER=`cat .git_hash`
+       wget https://github.com/raspberrypi/linux/archive/$GIT_VER.zip -O raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+       unzip raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+       mv linux-$GIT_VER linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+       #-----------------------------------------------------------------------
+       rm raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
+
+# download headers and symbols
 wget http://archive.raspberrypi.org/debian/${RPI_FIRMWARE_FILE}
 dpkg-deb -x `basename ${RPI_FIRMWARE_FILE}` h
+
+# prepare kernel tree and compile module
 KERNEL_VER=`ls -1 h/lib/modules | grep '\-v7'`
 echo $KERNEL_VER
 cp h/usr/src/linux-headers-${KERNEL_VER}/.config linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
index 8d1b28867155108ad42f77bc589c468470882a48..b9088e2d78d1d143a42ffb46a9ecd5e95297f826 100644 (file)
@@ -49,9 +49,13 @@ default: all ;
 all: 
        make ARCH=arm CROSS_COMPILE=${CCPREFIX} -C ${LINUX_DIR_PATH} M=${PWD} modules
 
+modules_install: 
+       make ARCH=arm CROSS_COMPILE=${CCPREFIX} -C ${LINUX_DIR_PATH} M=${PWD} modules_install
+
 clean: 
-       make -C ${LINUX_DIR_PATH} M=$(PWD) clean
-       rm -f ${BIN_DIR_PATH}/${KERNEL_MODULE_NAME}.ko
+       rm -f ${unipi-objs} src/.*.o.cmd
+       rm -f ${KERNEL_MODULE_NAME}.ko ${KERNEL_MODULE_NAME}.mod.c .*.o.cmd .*.ko.cmd *.o modules.order Module.symvers
+       rm -rf .tmp_versions
 
 transfer: clean symlink
        scp ${BIN_DIR_PATH}/${KERNEL_MODULE_NAME}.ko ${TARGET_PLC_PATH}
diff --git a/modules/unipi/bin/.dummy b/modules/unipi/bin/.dummy
deleted file mode 100644 (file)
index 664bbb0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# Compiled binaries go here
diff --git a/modules/unipi/current b/modules/unipi/current
deleted file mode 100755 (executable)
index d79fb96..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-##########################################
-##
-## compile module agains kernel tree in tmp
-##
-##########################################
-
-cd tmp
-. versions
-
-
-KERNEL_VER=`ls -1 h/lib/modules | grep '\-v7'`
-echo $KERNEL_VER
-cp h/usr/src/linux-headers-${KERNEL_VER}/.config linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-cp h/usr/src/linux-headers-${KERNEL_VER}/Module.symvers linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-cd linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-make modules_prepare CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
-cd ../..
-make all CCPREFIX=arm-linux-gnueabi- ARCH=arm LINUX_DIR_PATH=tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
diff --git a/modules/unipi/raspbian b/modules/unipi/raspbian
deleted file mode 100755 (executable)
index 464d0dd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-###############################################
-#
-# check latest raspbian kernel version, download it to directory tmp
-# compile module 
-#################################################
-
-mkdir -p tmp
-
-# get latest raspbian kernel version
-wget -q http://archive.raspberrypi.org/debian/dists/stretch/main/binary-armhf/Packages.gz -O - | gunzip \
-| awk '/^Package: raspberrypi-kernel-headers[[:blank:]]*$/ { ok=1; next} /^Package: / {ok=0;} (ok!=1) {next} 
-       /^Version: / {print "RPI_FIRMWARE_VER=" $2 } 
-       /^Filename: / {print "RPI_FIRMWARE_FILE=" $2; nextfile }' > tmp/versions
-
-cd tmp
-. versions
-
-# get kernel source
-#-----------------------------------------------------------------------
-# this method doesn't work if tag in git wasn't created
-#wget https://github.com/raspberrypi/linux/archive/raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-#unzip raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-
-# alternate method to get raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-# get commit number used for making this kernel version
-
-       wget https://raw.githubusercontent.com/raspberrypi/firmware/stable/extra/git_hash -O- > .git_hash
-       GIT_VER=`cat .git_hash`
-       wget https://github.com/raspberrypi/linux/archive/$GIT_VER.zip -O raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-       unzip raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-       mv linux-$GIT_VER linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-       #-----------------------------------------------------------------------
-       rm raspberrypi-kernel_${RPI_FIRMWARE_VER}.zip
-
-# download headers and symbols
-wget http://archive.raspberrypi.org/debian/${RPI_FIRMWARE_FILE}
-dpkg-deb -x `basename ${RPI_FIRMWARE_FILE}` h
-
-# prepare kernel tree and compile module
-KERNEL_VER=`ls -1 h/lib/modules | grep '\-v7'`
-echo $KERNEL_VER
-cp h/usr/src/linux-headers-${KERNEL_VER}/.config linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-cp h/usr/src/linux-headers-${KERNEL_VER}/Module.symvers linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-cd linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-make modules_prepare CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
-cd ../..
-make all CCPREFIX=arm-linux-gnueabi- ARCH=arm LINUX_DIR_PATH=tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
index 32cab2cceed9ef52f77c39573a4ad2bbddeb45f4..9970fe60b96f69469b836ce856d25f48c1046c52 100644 (file)
@@ -51,7 +51,7 @@
 #if NEURONSPI_SCHED_REQUIRED > 0
        #include <uapi/linux/sched/types.h>
 #endif
-#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.15:2018:09:14"
+#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.16:2018:09:21"
 
 #define NEURONSPI_MAX_DEVS                             3
 #define NEURONSPI_MAX_UART                             16