summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2023-12-19 03:12:22 -0500
committerChris Severance2023-12-19 03:12:22 -0500
commit510e4ad721301260b00f2e4595a324a4988b19f6 (patch)
tree3c6adce67525964fb06d755a5ace970747bcbeef
parent02e778057ac0fcde0f87a14d8a69e7e87de8af6e (diff)
downloadaur-sunix-snx.tar.gz
autu: Update to 2.0.8_0-1
-rw-r--r--.SRCINFO21
-rw-r--r--0005-kernel-6.0-set_termios-const-ktermios.patch4
-rw-r--r--0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch39
-rw-r--r--0008-kernel-6.6-struct-tty_operations-write-size_t.patch37
-rw-r--r--0009-kernel-6.4-class_create-1arg.patch39
-rw-r--r--PKGBUILD67
6 files changed, 178 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8a80661db0b4..9342989bab9b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = sunix-snx
pkgdesc = kernel module driver for Sunix SUN1889 SUN1989 SUN1999 SUN2212 SUN2410 UL7502AQ UL7512EQ UL7522EQ PCI PCIe multi I/O parallel serial RS-232 422 485 port Dell Lenovo Acer Startech
- pkgver = 2.0.7_0
+ pkgver = 2.0.8_0
pkgrel = 1
url = http://www.sunix.com/
install = sunix-snx-install.sh
@@ -16,26 +16,35 @@ pkgbase = sunix-snx
depends = linux
depends = dkms
depends = linux-headers
- source = http://www.sunix.com/en/download.php?file=driver&file_link=download/driver/2022/20220531161341_snx_V2.0.7.0.zip
+ source = http://www.sunix.com/en/download.php?file=driver&file_link=download/driver/2023/20230427142706_snx_V2.0.8.0.zip
source = 0001-kernel-4.7-async-initialized.patch
source = 0002-kernel-5.12-tty-low_latency.patch
source = 0003-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch
source = 0004-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
source = 0005-kernel-6.0-set_termios-const-ktermios.patch
source = 0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch
- md5sums = b673f1b48581036f44f77bc3ce2246f6
+ source = 0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
+ source = 0008-kernel-6.6-struct-tty_operations-write-size_t.patch
+ source = 0009-kernel-6.4-class_create-1arg.patch
+ md5sums = 04bd8a61796fabbef2bcae349dd8fae0
md5sums = 71564d580faaf72ab3518c298883742e
md5sums = e3604145fb2b1678da395a600e4cf1ed
md5sums = a16e94419d504663c50d3d7522b0c019
md5sums = 43db33db258f67122c58c3868d688d13
- md5sums = 88978ceeeef410d00a2d465d3c756f6a
+ md5sums = a2fbf035e4dddf5cab87317223435633
md5sums = 920cdd39dc868c2d216c23d180d9eb3e
- sha256sums = e46c22397886384ac6bd28401287b0e5f89fe1a1ac6a58518ba99774e59211be
+ md5sums = 7e16e1860e93a08a0591be4bfc8ca558
+ md5sums = 4b38b409ec2d9aa23b51578587e7033c
+ md5sums = d967f1bf0e7a16a778931223404fd046
+ sha256sums = 0997586558e219656543b5740e5202f31d2476dd0399e74d768277e862bb4746
sha256sums = 4ea9275ca8122543c25f17112d4c374dc39de32e3d9d1d0aa5488bacd514750d
sha256sums = ab0ef161b7c7053299b18ab9b697047d37142e9e88d53d40ac087f64522a55dd
sha256sums = 12a9d8f11c60cef0e70d0d5cba684146beb32eef76e7519728e2e4453f671251
sha256sums = fce8e15188f58fcfbea2720672709ea1e8d9e4703155c1222cf31ababd61807f
- sha256sums = b7972237d3b91a3bb93e27931e8c9a60037512571131687382b6a410dc7a668c
+ sha256sums = bc1aeab271927cbb62c9c2d2517f535bbd30646d997c99c757ed4b92fd474218
sha256sums = 71d3be91c017166ea523f0f1c7bc5d1e66d828d1de60923b24947be4cb960e01
+ sha256sums = 6e98100a00af103ac21a7054519296ebc1958f7e15f129199189a63c6de5332c
+ sha256sums = 628cb175f7b30e74d1c2f3ca78ccb9a9e4301f1d8e8756d25435581959e312a5
+ sha256sums = 2fedbe6763ce6b7363af62264794fce05ff7bc28e377cc580f697c7b5553df5c
pkgname = sunix-snx
diff --git a/0005-kernel-6.0-set_termios-const-ktermios.patch b/0005-kernel-6.0-set_termios-const-ktermios.patch
index 700f60f65cb6..997bad0c935a 100644
--- a/0005-kernel-6.0-set_termios-const-ktermios.patch
+++ b/0005-kernel-6.0-set_termios-const-ktermios.patch
@@ -7,7 +7,7 @@ diff -pNaru5 a/driver/snx_serial.c b/driver/snx_serial.c
static void snx_ser_hangup(struct tty_struct *);
unsigned int snx_ser_get_divisor(struct snx_ser_port *, unsigned int);
extern void snx_ser_change_speed(struct snx_ser_state *, struct SNXTERMIOS *);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
+static void snx_ser_set_termios(struct tty_struct *, const struct SNXTERMIOS *);
+#else
static void snx_ser_set_termios(struct tty_struct *, struct SNXTERMIOS *);
@@ -23,7 +23,7 @@ diff -pNaru5 a/driver/snx_serial.c b/driver/snx_serial.c
}
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
+static void snx_ser_set_termios(struct tty_struct *tty, const struct SNXTERMIOS *old_termios)
+#else
static void snx_ser_set_termios(struct tty_struct *tty, struct SNXTERMIOS *old_termios)
diff --git a/0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch b/0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
new file mode 100644
index 000000000000..51897bacad15
--- /dev/null
+++ b/0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
@@ -0,0 +1,39 @@
+diff -pNaru5 a/driver/snx_serial.c b/driver/snx_serial.c
+--- a/driver/snx_serial.c 2023-12-19 02:44:14.418405164 -0500
++++ b/driver/snx_serial.c 2023-12-19 02:44:14.421738526 -0500
+@@ -3,12 +3,16 @@
+
+ #define SNX_ioctl_DBG 0
+ #define EEPROM_ACCESS_DELAY_COUNT 100000
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ static DEFINE_SEMAPHORE(ser_port_sem);
+ #else
++ static DEFINE_SEMAPHORE(ser_port_sem,1);
++#endif
++#else
+ static DECLARE_MUTEX(ser_port_sem);
+ #endif
+
+
+ #define SNX_HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
+diff -pNaru5 a/driver/snx_share.c b/driver/snx_share.c
+--- a/driver/snx_share.c 2023-04-26 04:20:52.000000000 -0400
++++ b/driver/snx_share.c 2023-12-19 02:44:27.551851976 -0500
+@@ -37,11 +37,15 @@ static LIST_HEAD(snx_drivers);
+
+ static DECLARE_MUTEX(snx_registration_lock);
+
+ #else
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ static DEFINE_SEMAPHORE(snx_registration_lock);
++#else
++static DEFINE_SEMAPHORE(snx_registration_lock,1);
++#endif
+
+ #endif
+
+
+ static void sunix_dead_write_lines(struct snx_parport *p, unsigned char b) {}
diff --git a/0008-kernel-6.6-struct-tty_operations-write-size_t.patch b/0008-kernel-6.6-struct-tty_operations-write-size_t.patch
new file mode 100644
index 000000000000..95bb17c01424
--- /dev/null
+++ b/0008-kernel-6.6-struct-tty_operations-write-size_t.patch
@@ -0,0 +1,37 @@
+diff -pNaru5 a/driver/snx_serial.c b/driver/snx_serial.c
+--- a/driver/snx_serial.c 2023-12-19 02:26:30.058442176 -0500
++++ b/driver/snx_serial.c 2023-12-19 02:28:47.647025968 -0500
+@@ -86,12 +86,16 @@ static int snx_ser_set_info(struct
+ static unsigned int snx_ser_write_room(struct tty_struct *);
+ #else
+ static int snx_ser_write_room(struct tty_struct *);
+ #endif
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10))
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
+ static int snx_ser_write(struct tty_struct *, const unsigned char *, int);
+ #else
++static ssize_t snx_ser_write(struct tty_struct *, const unsigned char *, size_t);
++#endif
++#else
+ static int snx_ser_write(struct tty_struct *, int, const unsigned char *, int);
+ #endif
+ static int snx_ser_get_lsr_info(struct snx_ser_state *, unsigned int *);
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
+@@ -1124,12 +1128,16 @@ static int snx_ser_write_room(struct tty
+ return status;
+ }
+
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10))
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
+ static int snx_ser_write(struct tty_struct *tty, const unsigned char *buf, int count)
+ #else
++static ssize_t snx_ser_write(struct tty_struct *tty, const unsigned char *buf, size_t count)
++#endif
++#else
+ static int snx_ser_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
+ #endif
+ {
+ struct snx_ser_state *state = tty->driver_data;
+ struct circ_buf *circ = NULL;
diff --git a/0009-kernel-6.4-class_create-1arg.patch b/0009-kernel-6.4-class_create-1arg.patch
new file mode 100644
index 000000000000..6fccca104bc6
--- /dev/null
+++ b/0009-kernel-6.4-class_create-1arg.patch
@@ -0,0 +1,39 @@
+diff -pNaru5 a/driver/snx_lp.c b/driver/snx_lp.c
+--- a/driver/snx_lp.c 2018-11-10 05:13:34.000000000 -0500
++++ b/driver/snx_lp.c 2023-12-19 02:50:09.408124504 -0500
+@@ -928,12 +928,15 @@ static int snx_lp_init(void)
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
+ snx_devfs_handle = devfs_mk_dir(NULL, "sprinter", NULL);
+ #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17))
+ devfs_mk_dir("sprinter");
+ #else
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ snx_lp_class = class_create(THIS_MODULE, "sprinter");
+-
++#else
++ snx_lp_class = class_create("sprinter");
++#endif
+ if (IS_ERR(snx_lp_class)) {
+ err = PTR_ERR(snx_lp_class);
+ goto out_reg;
+ }
+ #endif
+diff -pNaru5 a/driver/snx_ppdev.c b/driver/snx_ppdev.c
+--- a/driver/snx_ppdev.c 2023-04-26 04:32:04.000000000 -0400
++++ b/driver/snx_ppdev.c 2023-12-19 02:49:38.138329748 -0500
+@@ -1381,11 +1381,15 @@ int sunix_par_ppdev_init(void)
+ #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17))
+ for (i = 2; i < SNX_PARPORT_MAX; i++) {
+ devfs_mk_cdev(MKDEV(SNX_PPD_MAJOR, i), S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i);
+ }
+ #else
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ snx_ppdev_class = class_create(THIS_MODULE, SNX_CHRDEV);
++#else
++ snx_ppdev_class = class_create(SNX_CHRDEV);
++#endif
+ if (IS_ERR(snx_ppdev_class)) {
+ err = PTR_ERR(snx_ppdev_class);
+ goto out_chrdev;
+ }
+
diff --git a/PKGBUILD b/PKGBUILD
index f693671d5ea1..cda448102835 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,6 +2,8 @@
_opt_DKMS=1 # This can be toggled between installs
+#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/5.10.*/modules.alias))"
+
# Todo: Unable to trigger timer to see if it works
# Todo: modprobe snx with conflicting major, again modeprobe snx crashes kernel
@@ -95,7 +97,8 @@ pkgname='sunix-snx'
#pkgver='2.0.4_2'; _dl='2016/20160706173626'
#pkgver='2.0.4_3'; _dl='2017/20171122180114'
#pkgver='2.0.5_0'; _dl='2021/20210407180737'
-pkgver='2.0.7_0'; _dl='2022/20220531161341'
+#pkgver='2.0.7_0'; _dl='2022/20220531161341'
+pkgver='2.0.8_0'; _dl='2023/20230427142706'
pkgrel='1'
pkgdesc='kernel module driver for Sunix SUN1889 SUN1989 SUN1999 SUN2212 SUN2410 UL7502AQ UL7512EQ UL7522EQ PCI PCIe multi I/O parallel serial RS-232 422 485 port Dell Lenovo Acer Startech'
arch=('i686' 'x86_64')
@@ -122,21 +125,30 @@ source=(
'0004-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
'0005-kernel-6.0-set_termios-const-ktermios.patch'
'0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch'
+ '0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch'
+ '0008-kernel-6.6-struct-tty_operations-write-size_t.patch'
+ '0009-kernel-6.4-class_create-1arg.patch'
)
-md5sums=('b673f1b48581036f44f77bc3ce2246f6'
+md5sums=('04bd8a61796fabbef2bcae349dd8fae0'
'71564d580faaf72ab3518c298883742e'
'e3604145fb2b1678da395a600e4cf1ed'
'a16e94419d504663c50d3d7522b0c019'
'43db33db258f67122c58c3868d688d13'
- '88978ceeeef410d00a2d465d3c756f6a'
- '920cdd39dc868c2d216c23d180d9eb3e')
-sha256sums=('e46c22397886384ac6bd28401287b0e5f89fe1a1ac6a58518ba99774e59211be'
+ 'a2fbf035e4dddf5cab87317223435633'
+ '920cdd39dc868c2d216c23d180d9eb3e'
+ '7e16e1860e93a08a0591be4bfc8ca558'
+ '4b38b409ec2d9aa23b51578587e7033c'
+ 'd967f1bf0e7a16a778931223404fd046')
+sha256sums=('0997586558e219656543b5740e5202f31d2476dd0399e74d768277e862bb4746'
'4ea9275ca8122543c25f17112d4c374dc39de32e3d9d1d0aa5488bacd514750d'
'ab0ef161b7c7053299b18ab9b697047d37142e9e88d53d40ac087f64522a55dd'
'12a9d8f11c60cef0e70d0d5cba684146beb32eef76e7519728e2e4453f671251'
'fce8e15188f58fcfbea2720672709ea1e8d9e4703155c1222cf31ababd61807f'
- 'b7972237d3b91a3bb93e27931e8c9a60037512571131687382b6a410dc7a668c'
- '71d3be91c017166ea523f0f1c7bc5d1e66d828d1de60923b24947be4cb960e01')
+ 'bc1aeab271927cbb62c9c2d2517f535bbd30646d997c99c757ed4b92fd474218'
+ '71d3be91c017166ea523f0f1c7bc5d1e66d828d1de60923b24947be4cb960e01'
+ '6e98100a00af103ac21a7054519296ebc1958f7e15f129199189a63c6de5332c'
+ '628cb175f7b30e74d1c2f3ca78ccb9a9e4301f1d8e8756d25435581959e312a5'
+ '2fedbe6763ce6b7363af62264794fce05ff7bc28e377cc580f697c7b5553df5c')
if [ "${_opt_DKMS}" -ne 0 ]; then
depends+=('linux' 'dkms' 'linux-headers')
@@ -167,6 +179,12 @@ prepare() {
_install_check
cd "${_srcdir}"
+ # Kernel 3,4,5 all use the same makefile. Trim out everything but Kernel 4
+ mv driver/Makefile{,.Arch}
+ sed -n -e '/^# for kernel 4.0/,/^# for kernel 3.0/ p' 'driver/Makefile.Arch' > 'driver/Makefile'
+ sed -e '/findstring 4./ s:^:#:g' -i 'driver/Makefile'
+ rm 'driver/Makefile.Arch'
+
# Make package compatible and fix some version problems
#cp -p 'driver/Makefile'{,.Arch}
sed -e 's: /lib/modules/: /usr/lib/modules/:g' \
@@ -189,6 +207,13 @@ prepare() {
-e '/findstring / s:uname -a:uname -r:g ' \
-e '# Kernel 5.4 compatible' \
-e 's: SUBDIRS=\([^ ]\+\) : M=\1&:g ' \
+ -e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
+ -e 's:shell uname -r:KERNELRELEASE:g' \
+ -e '# DKMS sets KERNELRELEASE which accidentally launches phase 2 of this Makefile' \
+ -e '# Fix by changing the detection var.' \
+ -e '# SUBDIRS makes more sense to me because I can see it in the Makefile!' \
+ -e 's:ifneq ($(KERNELRELEASE),):ifneq ($(SUBDIRS),):g' \
+ -e '1i KERNELRELEASE?=$(shell uname -r)' \
-i 'driver/Makefile'
sed -e '/^install:/,/^$/ s: /usr/: "${DESTDIR}"/usr/:g' -i 'snxdump/Makefile' 'snxterm/Makefile'
! test -s 'driver/Makefile.Arch' || echo "${}"
@@ -232,18 +257,25 @@ prepare() {
# diff -pNaru5 'a' 'b' > '0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch'
patch -Nup1 -i "${srcdir}/0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch"
- # Kernel 3,4,5 all use the same makefile. Trim out everything but Kernel 4
- mv driver/Makefile{,.Arch}
- sed -n -e '/^# for kernel 4.0/,/^# for kernel 3.0/ p' 'driver/Makefile.Arch' > 'driver/Makefile'
- sed -e '/findstring =4./ s:^:#:g' -i 'driver/Makefile'
- rm 'driver/Makefile.Arch'
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; cd "${_srcdir}"; false
+ # diff -pNaru5 'a' 'b' > '0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch'
+ patch -Nup1 -i "${srcdir}/0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch"
+
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; cd "${_srcdir}"; false
+ # diff -pNaru5 'a' 'b' > '0008-kernel-6.6-struct-tty_operations-write-size_t.patch'
+ patch -Nup1 -i "${srcdir}/0008-kernel-6.6-struct-tty_operations-write-size_t.patch"
+
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; cd "${_srcdir}"; false
+ # diff -pNaru5 'a' 'b' > '0009-kernel-6.4-class_create-1arg.patch'
+ patch -Nup1 -i "${srcdir}/0009-kernel-6.4-class_create-1arg.patch"
+
set +u
}
build() {
set -u
cd "${_srcdir}"
- make -s -j1 # too small for parallel make
+ make -j1 # too small for parallel make
set +u
}
@@ -264,7 +296,7 @@ package() {
make -s -j1 DESTDIR="${pkgdir}" install
# Don't install two copies.
- rm -r "${pkgdir}/usr/lib/modules/$(uname -r)/misc"
+ rm -r "${pkgdir}/usr/lib/modules"/*/misc
# The module is in the same folder as DKMS. Compress to a different name to prevent conflict.
# When future versions of DKMS compress we'll stop doing this.
@@ -310,13 +342,6 @@ EOF
) "${_dkms}/dkms.conf"
install -dm755 "${_dkms}/driver/"
cp -pr 'driver/' "${_dkms}/"
- sed -e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
- -e 's:shell uname -r:KERNELRELEASE:g' \
- -e '# DKMS sets KERNELRELEASE which accidentally launches phase 2 of this Makefile' \
- -e '# Fix by changing the detection var.' \
- -e '# SUBDIRS makes more sense to me because I can see it in the Makefile!' \
- -e 's:ifneq ($(KERNELRELEASE),):ifneq ($(SUBDIRS),):g' \
- -i "${_dkms}/driver/Makefile"
make -s -C "${_dkms}/driver/" clean KERNELRELEASE="$(uname -r)"
fi
set +u