summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD22
-rw-r--r--dkms-frandom.install39
-rw-r--r--kernel412.patch13
4 files changed, 32 insertions, 51 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0a81cba22f0..654f11f9626 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,22 +1,25 @@
+# Generated by mksrcinfo v8
+# Sat Jul 29 20:06:55 UTC 2017
pkgbase = dkms-frandom
pkgdesc = A very fast random number generator kernel module (DKMS version)
pkgver = 1.1
- pkgrel = 4
+ pkgrel = 5
url = http://frandom.sourceforge.net/
- install = dkms-frandom.install
arch = any
license = GPL
depends = dkms
- depends = linux-headers
+ optdepends = linux-headers
provides = frandom=1.1
conflicts = frandom
options = !strip
source = http://prdownloads.sourceforge.net/frandom/frandom-1.1.tar.gz
source = frandom.udev.patch
+ source = kernel412.patch
source = dkms.conf
source = Makefile
md5sums = aade48078496da7439eda41937a34e61
md5sums = f9a36f3a3c7f9caaae6475f6edea079c
+ md5sums = 57ef5bb4df764a508264a49f00c70609
md5sums = 6b6ac64454740d8ba7d065a1ae903701
md5sums = 1e94254311f05274035b5e41ff5a7a33
diff --git a/PKGBUILD b/PKGBUILD
index 9e0753f424c..8c02f3fe1df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,35 +4,39 @@
pkgname=dkms-frandom
pkgver=1.1
-pkgrel=4
+pkgrel=5
pkgdesc="A very fast random number generator kernel module (DKMS version)"
arch=('any')
url="http://frandom.sourceforge.net/"
license=('GPL')
-depends=('dkms' 'linux-headers')
+depends=('dkms')
+optdepends=('linux-headers')
provides=("frandom=${pkgver}")
conflicts=("frandom")
-install=${pkgname}.install
options=(!strip)
_pkgname=frandom
source=("http://prdownloads.sourceforge.net/$_pkgname/$_pkgname-$pkgver.tar.gz"
'frandom.udev.patch'
+'kernel412.patch'
'dkms.conf'
'Makefile')
-build(){
- patch $srcdir/$_pkgname-$pkgver/10-frandom.rules $srcdir/frandom.udev.patch
+build() {
+ cd "$srcdir/$_pkgname-${pkgver}"
+ patch -p1 -i "$srcdir/frandom.udev.patch"
+ patch -p1 -i "$srcdir/kernel412.patch"
}
package() {
- install -dm755 "$pkgdir/usr/src/$_pkgname-$pkgver"
- install -m644 "$srcdir/$_pkgname-$pkgver/"* "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -dm755 "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -m644 "$srcdir/$_pkgname-$pkgver/"* "$pkgdir/usr/src/$_pkgname-$pkgver"
install -Dm644 "$srcdir/$_pkgname-$pkgver/10-$_pkgname.rules" "$pkgdir/usr/lib/udev/rules.d/10-$_pkgname.rules"
- install -m644 "$srcdir/dkms.conf" "$pkgdir/usr/src/$_pkgname-$pkgver"
- install -m644 "$srcdir/Makefile" "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -m644 "$srcdir/dkms.conf" "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -m644 "$srcdir/Makefile" "$pkgdir/usr/src/$_pkgname-$pkgver"
}
md5sums=('aade48078496da7439eda41937a34e61'
'f9a36f3a3c7f9caaae6475f6edea079c'
+ '57ef5bb4df764a508264a49f00c70609'
'6b6ac64454740d8ba7d065a1ae903701'
'1e94254311f05274035b5e41ff5a7a33')
diff --git a/dkms-frandom.install b/dkms-frandom.install
deleted file mode 100644
index 18ba932f418..00000000000
--- a/dkms-frandom.install
+++ /dev/null
@@ -1,39 +0,0 @@
-post_install (){
- DKMS=$(which dkms)
-
- $DKMS add -m frandom -v 1.1
- $DKMS build -m frandom -v 1.1
- $DKMS install -m frandom -v 1.1
- /usr/bin/depmod -a
-}
-
-pre_upgrade(){
- pre_remove
-}
-
-post_upgrade(){
- post_install
-}
-
-pre_remove (){
- _inmemory=$(/usr/bin/lsmod | /usr/bin/grep frandom)
- if [ ! -z "$_inmemory" ]; then
- /usr/bin/rmmod frandom &> /dev/null
- fi
-
- DKMS=$(which dkms)
-
- _line=$($DKMS status -m frandom)
- if echo "$_line" | grep -E 'added|built|installed'; then
- version=$(echo "$_line" | sed 's/frandom,\([^,]*\)[,:].*/\1/;t;d')
- $DKMS remove -m frandom -v $version --all
- fi
-}
-
-post_remove () {
- /usr/bin/depmod -a
-}
-
-op=$1
-shift
-$op $*
diff --git a/kernel412.patch b/kernel412.patch
new file mode 100644
index 00000000000..ba15f6f80f1
--- /dev/null
+++ b/kernel412.patch
@@ -0,0 +1,13 @@
+diff -ruN frandom-1.1/frandom.c frandom-1.1-patched/frandom.c
+--- frandom-1.1/frandom.c 2011-07-27 23:14:14.000000000 +0100
++++ frandom-1.1-patched/frandom.c 2017-07-29 20:56:05.891476396 +0100
+@@ -26,6 +26,9 @@
+ #include <linux/random.h>
+
+ #include <asm/uaccess.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++#include <linux/uaccess.h>
++#endif
+ #include <linux/cdev.h>
+ #include <linux/err.h>
+ #include <linux/device.h>