summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dworak2015-09-09 09:18:53 -0500
committerWalter Dworak2015-09-09 09:18:53 -0500
commit53d02654fd404e3b52c63c09d806e5dc826401a6 (patch)
treed7b76b8002258035faef79e134100be35658772c
downloadaur-53d02654fd404e3b52c63c09d806e5dc826401a6.tar.gz
Initial Package Release
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD50
-rw-r--r--linux_4.patch114
-rw-r--r--rr62x.install28
4 files changed, 210 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c4c949f57d4d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = rr62x
+ pkgdesc = Kernel modules for Highpoint RocketRAID 62x SATA/6Gbps Card.
+ pkgver = 1.2
+ pkgrel = 1
+ url = http://www.highpoint-tech.com/USA_new/series_rr600-download.htm
+ install = rr62x.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = linux-headers
+ depends = linux
+ source = http://www.highpoint-tech.com/BIOS_Driver/rr62x/linux/rr62x-linux-src-v1.2-120601-1355.tar.gz
+ source = linux_4.patch
+ md5sums = b308bcba65d065cddf05d9b7dea8f3d6
+ md5sums = d4fbdc757b8e061410396f0c829958f9
+
+pkgname = rr62x
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..96ccb0cb24e9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+#Maintainer: Walter Dworak <preparatioh67 at gmail dot com>
+# Contributor: Alessandro Sagratini <ale_sagra at hotmail dot com>
+pkgname=rr62x
+pkgver=1.2
+pkgrel=1
+pkgdesc="Kernel modules for Highpoint RocketRAID 62x SATA/6Gbps Card."
+arch=('i686' 'x86_64')
+url="http://www.highpoint-tech.com/USA_new/series_rr600-download.htm"
+license=('custom')
+groups=()
+
+depends=('linux')
+makedepends=('linux-headers')
+
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=$pkgname.install
+source=(http://www.highpoint-tech.com/BIOS_Driver/rr62x/linux/rr62x-linux-src-v1.2-120601-1355.tar.gz linux_4.patch)
+noextract=()
+md5sums=('b308bcba65d065cddf05d9b7dea8f3d6' 'd4fbdc757b8e061410396f0c829958f9')
+_extramodules=extramodules-"$(uname -r | cut -d. -f1,2)"-ARCH
+_kernver="$(uname -r)"
+
+build() {
+ if [ ! -e /lib/modules/$_kernver/build/ ]; then
+ echo Cannot find kernel souce code from /lib/modules/$_kernver/build/
+ exit 1
+ fi
+ cd $srcdir/
+ # Apply the Linux version 4 patch
+ patch -p0 < ./linux_4.patch
+
+ cd rr62x-linux-src-v$pkgver/product/rr62x/linux/
+ make || return 1
+}
+
+package() {
+ cd rr62x-linux-src-v$pkgver/product/rr62x/linux/
+
+ # Install the kernel module
+ #mkdir -p "${pkgdir}/usr/lib/modules/${_extramodules}/"
+ install -m 644 -D rr62x.ko "${pkgdir}/usr/lib/modules/${_extramodules}/drivers/scsi/rr62x/rr62x.ko"
+ gzip "${pkgdir}/usr/lib/modules/${_extramodules}/rr62x.ko"
+
+ mkdir -p $pkgdir/usr/share/licenses/$pkgname
+ cp $srcdir/rr62x-linux-src-v$pkgver/README $pkgdir/usr/share/licenses/$pkgname/
+}
diff --git a/linux_4.patch b/linux_4.patch
new file mode 100644
index 000000000000..1040d86f3ad5
--- /dev/null
+++ b/linux_4.patch
@@ -0,0 +1,114 @@
+diff -aur rr62x-linux-src-v1.2.orig/inc/linux/Makefile.def rr62x-linux-src-v1.2/inc/linux/Makefile.def
+--- rr62x-linux-src-v1.2.orig/inc/linux/Makefile.def 2012-05-28 12:13:49.000000000 +0300
++++ rr62x-linux-src-v1.2/inc/linux/Makefile.def 2015-05-17 16:07:11.076666668 +0300
+@@ -74,18 +74,26 @@
+ KERNELDIR := /lib/modules/$(shell uname -r)/build
+ endif
+
+-MAJOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 65536 % 65536)
+-MINOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
+-KERNEL_VER := $(MAJOR).$(MINOR)
++ifneq (,$(wildcard $(KERNELDIR)/include/linux/version.h))
++ MAJOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 65536 % 65536)
++ MINOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
++ KERNEL_VER := $(MAJOR).$(MINOR)
++else
++ KERNEL_VER := $(shell cd $(KERNELDIR) ; make kernelversion | cut -d. -f1,2)
++ MAJOR := $(firstword $(subst ., ,$(KERNEL_VER)))
++ MINOR := $(word 2,$(subst ., ,$(KERNEL_VER)))
++endif
+
+ ifeq ($(KERNEL_VER),)
+ $(error Cannot find kernel version. Check $(KERNELDIR)/include/linux/version.h.)
+ endif
+
++ifneq ($(MAJOR), 4)
+ ifneq ($(MAJOR), 3)
+ ifneq ($(KERNEL_VER), 2.6)
+ ifneq ($(KERNEL_VER), 2.4)
+-$(error Only kernel 2.4/2.6/3.x is supported but you use $(KERNEL_VER))
++$(error Only kernel 2.4/2.6/3.x/4.x is supported but you use $(KERNEL_VER))
++endif
+ endif
+ endif
+ endif
+diff -aur rr62x-linux-src-v1.2.orig/osm/linux/osm_linux.c rr62x-linux-src-v1.2/osm/linux/osm_linux.c
+--- rr62x-linux-src-v1.2.orig/osm/linux/osm_linux.c 2012-06-01 08:55:36.000000000 +0300
++++ rr62x-linux-src-v1.2/osm/linux/osm_linux.c 2015-05-17 17:46:14.696666665 +0300
+@@ -449,7 +449,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+ struct scatterlist *sg;
+ sg = scsi_sglist(cmd);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
++ *pbuf = kmap_atomic(HPT_SG_PAGE(sg)) + sg->offset;
++#else
+ *pbuf = kmap_atomic(HPT_SG_PAGE(sg), HPT_KMAP_TYPE) + sg->offset;
++#endif
+ buflen = sg->length;
+ #else
+
+@@ -479,7 +483,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+ struct scatterlist *sg;
+ sg = scsi_sglist(cmd);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
++ kunmap_atomic((char *)buf - sg->offset);
++#else
+ kunmap_atomic((char *)buf - sg->offset, HPT_KMAP_TYPE);
++#endif
+ #else
+
+ if (cmd->use_sg) {
+@@ -1706,6 +1714,7 @@
+ }
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static int hpt_proc_set_info(struct Scsi_Host *host, char *buffer, int length)
+ {
+ IOCTL_ARG ioctl_args;
+@@ -1808,6 +1817,7 @@
+ else
+ return hpt_proc_get_info(host, buffer, start, offset, length);
+ }
++#endif
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+ static int hpt_proc_info24(char *buffer,char **start, off_t offset,
+@@ -2108,7 +2118,9 @@
+ #endif
+ #else /* 2.6.x */
+ proc_name: driver_name,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ proc_info: hpt_proc_info26,
++#endif
+ max_sectors: 128,
+ #endif
+ this_id: -1
+diff -aur rr62x-linux-src-v1.2.orig/osm/linux/osm_linux.h rr62x-linux-src-v1.2/osm/linux/osm_linux.h
+--- rr62x-linux-src-v1.2.orig/osm/linux/osm_linux.h 2012-06-01 08:55:36.000000000 +0300
++++ rr62x-linux-src-v1.2/osm/linux/osm_linux.h 2015-05-17 17:00:33.123333336 +0300
+@@ -176,7 +176,9 @@
+ #endif
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ #define HPT_KMAP_TYPE KM_BIO_SRC_IRQ
++#endif
+ #define HPT_FIND_PCI_DEVICE pci_get_device
+ #else
+ #define HPT_KMAP_TYPE KM_BH_IRQ
+Only in rr62x-linux-src-v1.2/product/rr62x/linux: .build
+diff -aur rr62x-linux-src-v1.2.orig/product/rr62x/linux/config.c rr62x-linux-src-v1.2/product/rr62x/linux/config.c
+--- rr62x-linux-src-v1.2.orig/product/rr62x/linux/config.c 2012-06-01 08:55:35.000000000 +0300
++++ rr62x-linux-src-v1.2/product/rr62x/linux/config.c 2015-05-17 17:43:47.623333322 +0300
+@@ -23,7 +23,7 @@
+
+ char driver_name[] = "rr62x";
+ char driver_name_long[] = "RocketRAID 62x SATA controller driver";
+-char driver_ver[] = "v1.2 (" __DATE__ " " __TIME__ ")";
++char driver_ver[] = "v1.2 (Jul 1 2012)";
+ int osm_max_targets = 32;
+
+ int os_max_cache_size = 0x800000;
+Only in rr62x-linux-src-v1.2/product/rr62x/linux: rr62x.ko
diff --git a/rr62x.install b/rr62x.install
new file mode 100644
index 000000000000..566c7678d0cd
--- /dev/null
+++ b/rr62x.install
@@ -0,0 +1,28 @@
+
+# This is a default template for a post-install scriptlet. You can
+# remove any functions you don't need (and this header).
+
+KERNEL_VERSION="$(uname -r)"
+
+# arg 1: the new package version
+pre_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+post_install() {
+ depmod -v $KERNEL_VERSION > /dev/null 2>&1
+ mkinitcpio -p linux
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install
+}
+
+# arg 1: the old package version
+post_remove() {
+ depmod -v $KERNEL_VERSION > /dev/null 2>&1
+ mkinitcpio -p linux
+}