diff options
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 45 | ||||
-rw-r--r-- | dkms.conf | 9 | ||||
-rw-r--r-- | linux_4.patch | 114 | ||||
-rwxr-xr-x | rr62x-dkms.install | 15 |
5 files changed, 205 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3c2b43573ba5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = rr62x-dkms + pkgdesc = Kernel modules for Highpoint RocketRAID 62x SATA/6Gbps Card. (DKMS Version) + pkgver = 1.2 + pkgrel = 1 + url = http://www.highpoint-tech.com/USA_new/series_rr600-download.htm + install = rr62x-dkms.install + arch = i686 + arch = x86_64 + license = custom + makedepends = linux-headers + depends = linux>=4.0 + conflicts = rr62x + conflicts = rr62x-lts + source = http://www.highpoint-tech.com/BIOS_Driver/rr62x/linux/rr62x-linux-src-v1.2-120601-1355.tar.gz + source = linux_4.patch + source = dkms.conf + md5sums = b308bcba65d065cddf05d9b7dea8f3d6 + md5sums = d4fbdc757b8e061410396f0c829958f9 + md5sums = 5a5b4137c86a3da4005bcfbe98b49660 + +pkgname = rr62x-dkms + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..88c7228c3406 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +#Maintainer: Walter Dworak <preparatioh67 at gmail dot com> +# Contributor: Alessandro Sagratini <ale_sagra at hotmail dot com> +_pkgbase=rr62x +pkgname=rr62x-dkms +pkgver=1.2 +pkgrel=1 +pkgdesc="Kernel modules for Highpoint RocketRAID 62x SATA/6Gbps Card. (DKMS Version)" +arch=('i686' 'x86_64') +url="http://www.highpoint-tech.com/USA_new/series_rr600-download.htm" +license=('custom') +groups=() + +depends=('linux>=4.0') +makedepends=('linux-headers') + +conflicts=('rr62x' 'rr62x-lts') +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 dkms.conf) +md5sums=('b308bcba65d065cddf05d9b7dea8f3d6' 'd4fbdc757b8e061410396f0c829958f9' '5a5b4137c86a3da4005bcfbe98b49660') +_extramodules=extramodules-"$(uname -r | cut -d. -f1,2)"-ARCH +_kernver="$(uname -r)" + +prepare() { + cd $srcdir/ + patch -p0 < ./linux_4.patch +} + +package() { + cd $srcdir/$_pkgbase-linux-src-v$pkgver/ + #mv $srcdir/$_pkgbase-linux-src-v$pkgver/product/$_pkgbase/linux/Makefile $srcdir/$_pkgbase-linux-src-v$pkgver/ + #mv $srcdir/$_pkgbase-linux-src-v$pkgver/product/$_pkgbase/linux/config.c $srcdir/$_pkgbase-linux-src-v$pkgver/ + cd product/$_pkgbase/linux + make + install -dm755 "$pkgdir/usr/src/$_pkgbase-$pkgver" + cd $srcdir/$_pkgbase-linux-src-v$pkgver/ + cp -a ./* $pkgdir/usr/src/$_pkgbase-$pkgver/ + chmod -R 755 "$pkgdir/usr/src/$_pkgbase-$pkgver" + install -Dm644 "$srcdir/dkms.conf" "$pkgdir/usr/src/$_pkgbase-$pkgver/dkms.conf" + sed -e "s/@_PKGBASE@/${_pkgbase}/" \ + -e "s/@PKGVER@/${pkgver}/" \ + -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf + + mkdir -p $pkgdir/usr/share/licenses/$pkgname + cp $srcdir/$_pkgbase-linux-src-v$pkgver/README $pkgdir/usr/share/licenses/$pkgname/ +} diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..c86440c67db2 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,9 @@ +PACKAGE_NAME="@_PKGBASE@" +PACKAGE_VERSION="@PKGVER@" +CLEAN="echo clean" +MAKE="cd product/rr62x/linux;make" +BUILT_MODULE_NAME="rr62x" +BUILT_MODULE_LOCATION="/product/rr62x/linux/.build" +DEST_MODULE_LOCATION="/extramodules" +AUTOINSTALL="yes" +REMAKE_INITRD=yes 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-dkms.install b/rr62x-dkms.install new file mode 100755 index 000000000000..72ad18be818e --- /dev/null +++ b/rr62x-dkms.install @@ -0,0 +1,15 @@ +post_install (){ + dkms install rr62x/${1%%-*} +} + +pre_upgrade(){ + pre_remove ${2%%-*} +} + +post_upgrade(){ + post_install ${1%%-*} +} + +pre_remove (){ + dkms remove rr62x/${1%%-*} --all +} |