diff options
author | Yifan Xu | 2019-06-15 21:43:36 +0000 |
---|---|---|
committer | Yifan Xu | 2019-06-15 21:43:36 +0000 |
commit | babafea5273a6231493617b4522da759c313d1d8 (patch) | |
tree | 0061ff1e7f08ca6687cf2eacca6fc459045de81f | |
download | aur-babafea5273a6231493617b4522da759c313d1d8.tar.gz |
create a AUR repo for AMD x370 RAID SATA/NVMe driver with DKMS
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 54 | ||||
-rw-r--r-- | dkms.conf | 7 | ||||
-rw-r--r-- | linux-4.15.patch | 357 |
5 files changed, 441 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..8d413e0466a2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = rcraid-dkms + pkgdesc = AMD AM4 socket X370 chipset motherbroad NVMe/SATA RAID driver (DKMS) + pkgver = 17.2.1 + pkgrel = 1 + url = https://www.amd.com/en/support/chipsets/amd-socket-am4/x370 + arch = i686 + arch = x86_64 + license = GPL2 + makedepends = linux-headers>=4.15 + depends = dkms + source = manual://raid_linux_driver_8_01_00_039_public.zip + source = dkms.conf + source = linux-4.15.patch + md5sums = f5692d2ef952f8c903af90cdd9eb3ce6 + md5sums = 3a14dcc84daf257a62727bcde1882edf + md5sums = 461866e715a1fded49a3f7c043a173d7 + +pkgname = rcraid-dkms + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..1443f48f5c7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +pkg/ +src/ +rcraid-dkms-*-x86_64.pkg.tar.xz +raid_linux_driver_*_public.zip diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7ca52f938619 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: foo <foo(at)example(dot)org> +# Contributor: bar <bar(at)example(dot)org> + +_pkgbase=rcraid +pkgname=rcraid-dkms +pkgver=17.2.1 +pkgrel=1 +pkgdesc="AMD AM4 socket X370 chipset motherbroad NVMe/SATA RAID driver (DKMS)" +arch=('i686' 'x86_64') +url="https://www.amd.com/en/support/chipsets/amd-socket-am4/x370" +license=('GPL2') +depends=('dkms') +makedepends=('linux-headers>=4.15') +# conflicts=("${_pkgbase}") +# install=${pkgname}.install +source=('manual://raid_linux_driver_8_01_00_039_public.zip' + 'dkms.conf' + 'linux-4.15.patch') +md5sums=('f5692d2ef952f8c903af90cdd9eb3ce6' + '3a14dcc84daf257a62727bcde1882edf' + '461866e715a1fded49a3f7c043a173d7') + +prepare() { + if [ ! -d ${_pkgbase}-${pkgver} ]; then + mkdir ${_pkgbase}-${pkgver} + fi + + cp driver_sdk/src/* ${_pkgbase}-${pkgver} +} + +build() { + cd ${_pkgbase}-${pkgver} + + patch -p1 -i "${srcdir}"/linux-4.15.patch + + make all +} + +package() { + # Copy dkms.conf + install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf + + # Set name and version + sed -e "s/@_PKGBASE@/${_pkgbase}/" \ + -e "s/@PKGVER@/${pkgver}/" \ + -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf + + cd ${_pkgbase}-${pkgver} + + install -Dm644 rcraid.ko "${pkgdir}"/usr/lib/modules/$(uname -r)/kernel/drivers/scsi/rcraid.ko + + make clean + cp -r * "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/ +} diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..f973090d7b03 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,7 @@ +PACKAGE_NAME="@_PKGBASE@" +PACKAGE_VERSION="@PKGVER@" +MAKE[0]="make KVERS=$kernelver" +CLEAN="make clean" +BUILT_MODULE_NAME[0]="@_PKGBASE@" +DEST_MODULE_LOCATION[0]="/kernel/drivers/scsi" +AUTOINSTALL="yes" diff --git a/linux-4.15.patch b/linux-4.15.patch new file mode 100644 index 000000000000..db0b44d994c2 --- /dev/null +++ b/linux-4.15.patch @@ -0,0 +1,357 @@ +diff -r -U3 old/common_shell new/common_shell +--- old/common_shell 2016-12-15 20:27:22.000000000 +0000 ++++ new/common_shell 2019-06-15 16:13:26.154950323 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Common shell routines used by the top level install script (SDK and driver + # disks) and also from the OS specific scripts in the SDK (also contains +diff -r -U3 old/install_rh new/install_rh +--- old/install_rh 2016-12-15 20:27:24.000000000 +0000 ++++ new/install_rh 2019-06-15 16:13:26.154950323 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Script to install the driver into the /lib/modules tree for RedHat distros. + # By default new drivers will be installed for the currently running kernel. +diff -r -U3 old/install_suse new/install_suse +--- old/install_suse 2016-12-15 20:27:24.000000000 +0000 ++++ new/install_suse 2019-06-15 16:13:26.154950323 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Script to install the driver into the /lib/modules tree for SuSE distros. + # By default new drivers will be installed for the currently running kernel. +Only in new: linux-4.15.patch +diff -r -U3 old/Makefile new/Makefile +--- old/Makefile 2016-12-15 20:27:24.000000000 +0000 ++++ new/Makefile 2019-06-15 20:26:28.867082834 +0000 +@@ -20,7 +20,7 @@ + RC_USER=$(shell whoami) + RC_DATE=$(shell /bin/date) + RC_BUILD_DATE=$(shell /bin/date +'%b %d %Y') +-PLATFORM=$(shell uname -i) ++PLATFORM=$(shell uname -m) + + EXTRA_CFLAGS += -D__LINUX__ + EXTRA_CFLAGS += -DRC_AHCI_SUPPORT -DRC_AMD_AHCI -DRC_AHCI_AUTOSENSE +@@ -89,7 +89,7 @@ + + obj-m := rcraid.o + +-rcraid-objs := rc_init.o rc_msg.o rc_mem_ops.o rc_event.o rc_config.o rcblob.${PLATFORM} \ ++rcraid-objs := rc_init.o rc_msg.o rc_mem_ops.o rc_event.o rc_config.o rcblob.${PLATFORM}.o \ + vers.o + + .PHONY: $(obj)/vers.c +@@ -98,6 +98,7 @@ + + # hack to avoid warning about missing .rcblob.cmd file when modpost tries to + # find all the sources +-.PHONY: $(obj)/rcblob.${PLATFORM} +-$(obj)/rcblob.${PLATFORM}: ++.PHONY: $(obj)/rcblob.${PLATFORM}.o ++$(obj)/rcblob.${PLATFORM}.o: ++ ln -sf `basename $@ .o` $@ + @( echo "cmd_$@ := true"; echo "dep_$@ := \\"; echo " $@ \\"; echo "" ) > $(obj)/.`basename $@`.cmd +Only in new: modules.order +Only in new: Module.symvers +diff -r -U3 old/rc_adapter.h new/rc_adapter.h +--- old/rc_adapter.h 2016-12-15 20:27:30.000000000 +0000 ++++ new/rc_adapter.h 2019-06-15 16:13:26.154950323 +0000 +@@ -40,7 +40,9 @@ + #define MAX_HBA 8 + #define MAX_TOTAL_PORTS (MAX_HBA * MAX_PORTS_PER_HA) + #define MAX_ARRAY 32 ++#ifndef SECTOR_SIZE + #define SECTOR_SIZE 512 ++#endif + + #define PCI_CFG_SIZE 256 + typedef struct rc_hw_info { +Only in new: rcblob.x86_64.o +Only in new: .rcblob.x86_64.o.cmd +Only in new: rc_config.o +Only in new: .rc_config.o.cmd +Only in new: rc_event.o +Only in new: .rc_event.o.cmd +diff -r -U3 old/rc_init.c new/rc_init.c +--- old/rc_init.c 2016-12-15 20:27:32.000000000 +0000 ++++ new/rc_init.c 2019-06-15 16:14:38.121619162 +0000 +@@ -165,11 +165,15 @@ + static int rc_eh_hba_reset(struct scsi_cmnd * scmd); + + void rc_shutdown_adapter(rc_adapter_t *adapter); +-int rc_ioctl(struct scsi_device * scsi_dev_ptr, int cmd, void *arg); ++int rc_ioctl(struct scsi_device * scsi_dev_ptr, unsigned int cmd, void *arg); + void rc_dump_scp(struct scsi_cmnd * scp); + const char *rc_info(struct Scsi_Host *host_ptr); + void rc_timeout(int to); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + void rc_timeout_done(unsigned long data); ++#else ++void rc_timeout_done(struct timer_list * t); ++#endif + static int rc_slave_cfg(struct scsi_device *sdev); + int rc_bios_params(struct scsi_device *sdev, struct block_device *bdev, + sector_t capacity, int geom[]); +@@ -342,7 +346,9 @@ + #if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,24) + .use_sg_chaining = ENABLE_SG_CHAINING, + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + .use_clustering = ENABLE_CLUSTERING, ++#endif + .slave_configure = rc_slave_cfg, + }; + +@@ -1964,7 +1970,7 @@ + + int + rc_ioctl (struct scsi_device * scsi_dev_ptr, +- int cmd, ++ unsigned int cmd, + void *arg) + { + char direction = 'w'; +@@ -2383,12 +2389,20 @@ + } + + void ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + rc_timeout_done(unsigned long data) ++#else ++rc_timeout_done(struct timer_list *t) ++#endif + { + rc_softstate_t *state; +- ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + state = (rc_softstate_t *)data; + init_timer(&state->rc_timeout); ++#else ++ state = from_timer(state, t, rc_timeout); ++ timer_setup(&state->rc_timeout, rc_timeout_done, 0); ++#endif + up(&state->rc_timeout_sema); + } + +@@ -2402,10 +2416,15 @@ + * set up timeout + */ + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + init_timer(&state->rc_timeout); + state->rc_timeout.expires = jiffies + to; + state->rc_timeout.data = (unsigned long)state; + state->rc_timeout.function = rc_timeout_done; ++#else ++ timer_setup(&state->rc_timeout, rc_timeout_done, 0); ++ state->rc_timeout.expires = jiffies + to; ++#endif + add_timer(&state->rc_timeout); + down(&state->rc_timeout_sema); + } +Only in new: rc_init.o +Only in new: .rc_init.o.cmd +diff -r -U3 old/rc_mem_ops.c new/rc_mem_ops.c +--- old/rc_mem_ops.c 2016-12-15 20:27:34.000000000 +0000 ++++ new/rc_mem_ops.c 2019-06-15 16:13:26.158283657 +0000 +@@ -19,6 +19,7 @@ + * + ****************************************************************************/ + ++#include "linux/signal.h" + #include "linux/vmalloc.h" + #include "linux/wait.h" + #include "linux/sched.h" +Only in new: rc_mem_ops.o +Only in new: .rc_mem_ops.o.cmd +diff -r -U3 old/rc_msg.c new/rc_msg.c +--- old/rc_msg.c 2016-12-15 20:27:34.000000000 +0000 ++++ new/rc_msg.c 2019-06-15 16:13:26.158283657 +0000 +@@ -37,10 +37,18 @@ + + void rc_msg_send_srb_function (rc_softstate_t *state, int function_code); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + void rc_msg_timer(unsigned long data); ++#else ++void rc_msg_timer(struct timer_list * t); ++#endif + + void rc_msg_timeout(int to); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + void rc_msg_timeout_done(unsigned long data); ++#else ++void rc_msg_timeout_done(struct timer_list * t); ++#endif + + void rc_msg_isr(rc_adapter_t *adapter); + void rc_msg_schedule_dpc(void); +@@ -200,15 +208,24 @@ + int32_t + rc_vprintf(uint32_t severity, const char *format, va_list ar) + { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ++ struct timespec ts; ++#else + struct timeval tv; +- static int rc_saw_newline=1; ++#endif ++ static int rc_saw_newline=1; + + if (severity > rc_msg_level) + return 0; + + if (severity && rc_saw_newline) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) ++ getnstimeofday(&ts); ++ printk("rcraid: (%li.%06li) ", ts.tv_sec, ts.tv_nsec / 1000); ++#else + do_gettimeofday(&tv); + printk("rcraid: (%li.%06li) ", tv.tv_sec, tv.tv_usec); ++#endif + } + + rc_saw_newline = strchr(format, '\n') ? 1 : 0; +@@ -1226,10 +1243,15 @@ + /* + * intialize the periodic timer for the OSIC + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + init_timer(&state->timer); + state->timer.expires = jiffies + state->timer_interval ; + state->timer.data = (unsigned long)state; + state->timer.function = rc_msg_timer; ++#else ++ timer_setup(&state->timer, rc_msg_timer, 0); ++ state->timer.expires = jiffies + state->timer_interval; ++#endif + state->state |= ENABLE_TIMER; + + add_timer(&state->timer); +@@ -1257,13 +1279,20 @@ + return(0); + } + void ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + rc_msg_timer(unsigned long data) ++#else ++rc_msg_timer(struct timer_list * t) ++#endif + { + rc_softstate_t *state; + rc_send_arg_t args; + +- ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + state = (rc_softstate_t *)data; ++#else ++ state = from_timer(state, t, timer); ++#endif + + if ((state->state & ENABLE_TIMER) == 0) + return; +@@ -1271,10 +1300,15 @@ + /* + * set up timeout + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + init_timer(&state->timer); + state->timer.expires = jiffies + state->timer_interval; + state->timer.data = (unsigned long)state; + state->timer.function = rc_msg_timer; ++#else ++ timer_setup(&state->timer, rc_msg_timer,0); ++ state->timer.expires = jiffies + state->timer_interval; ++#endif + add_timer(&state->timer); + + spin_lock(&state->osic_lock); +@@ -2342,12 +2376,21 @@ + + + void ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + rc_msg_timeout_done(unsigned long data) ++#else ++rc_msg_timeout_done(struct timer_list * t) ++#endif + { + rc_softstate_t *state; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + state = (rc_softstate_t *)data; + init_timer(&state->msg_timeout); ++#else ++ state = from_timer(state, t, msg_timeout); ++ timer_setup(&state->msg_timeout, rc_msg_timeout_done, 0); ++#endif + up(&state->msg_timeout_sema); + } + +@@ -2361,10 +2404,15 @@ + * set up timeout + */ + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + init_timer(&state->msg_timeout); + state->msg_timeout.expires = jiffies + to; + state->msg_timeout.data = (unsigned long)state; + state->msg_timeout.function = rc_msg_timeout_done; ++#else ++ timer_setup(&state->msg_timeout, rc_msg_timeout_done, 0); ++ state->msg_timeout.expires = jiffies + to; ++#endif + add_timer(&state->msg_timeout); + down(&state->msg_timeout_sema); + +@@ -2373,8 +2421,11 @@ + void + rc_msg_access_ok(rc_access_ok_t accessOk) + { +- +- accessOk.returnStatus = access_ok( VERIFY_WRITE , accessOk.access_location, accessOk.access_size); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++ accessOk.returnStatus = access_ok( accessOk.access_location, accessOk.access_size); ++#else ++ accessOk.returnStatus = access_ok( VERIFY_WRITE , accessOk.access_location, accessOk.access_size); ++#endif + } + + +Only in new: rc_msg.o +Only in new: .rc_msg.o.cmd +Only in new: rcraid.ko +Only in new: .rcraid.ko.cmd +Only in new: rcraid.mod.c +Only in new: rcraid.mod.o +Only in new: .rcraid.mod.o.cmd +Only in new: rcraid.o +Only in new: .rcraid.o.cmd +Only in new: .tmp_versions +diff -r -U3 old/uninstall_rh new/uninstall_rh +--- old/uninstall_rh 2016-12-15 20:27:38.000000000 +0000 ++++ new/uninstall_rh 2019-06-15 16:13:26.158283657 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # + # Script to remove the driver(s) from an existing SuSE linux install +diff -r -U3 old/uninstall_suse new/uninstall_suse +--- old/uninstall_suse 2016-12-15 20:27:38.000000000 +0000 ++++ new/uninstall_suse 2019-06-15 16:13:26.158283657 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # + # Script to remove the driver(s) from an existing SuSE linux install + # +Only in new: vers.c +Only in new: vers.o +Only in new: .vers.o.cmd |