diff options
author | Chris Severance | 2022-09-25 23:20:12 -0400 |
---|---|---|
committer | Chris Severance | 2022-09-25 23:20:12 -0400 |
commit | dbdbbc135443af2d905362f41b54ac218ef7e90c (patch) | |
tree | 636f49302e38f61d6d76f951697c4cff9edc77bd | |
parent | 04a24351766217f3e552764d9d31680430478293 (diff) | |
download | aur-dbdbbc135443af2d905362f41b54ac218ef7e90c.tar.gz |
autu: Update to 8.00-5
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | 0007-service-priority.patch | 30 | ||||
-rw-r--r-- | 0008-python3-firmware.patch | 199 | ||||
-rw-r--r-- | 0009-python3-nslink.patch | 45 | ||||
-rw-r--r-- | PKGBUILD | 51 |
5 files changed, 323 insertions, 15 deletions
@@ -1,7 +1,7 @@ pkgbase = nslink pkgdesc = tty driver and firmware update for Comtrol DeviceMaster, RTS, LT, PRO, 500, UP, RPSH-SI, RPSH, and Serial port Hub console terminal device server pkgver = 8.00 - pkgrel = 4 + pkgrel = 5 url = http://www.comtrol.com/ install = nslink-install.sh arch = i686 @@ -9,7 +9,7 @@ pkgbase = nslink license = GPL depends = glibc depends = openssl - depends = python2 + depends = python3 depends = sed depends = groff depends = tcl @@ -30,6 +30,9 @@ pkgbase = nslink source = 0004-kernel-5.12-tty-low_latency.patch source = 0005-kernel-5.14-unsigned-tty-flow-tty.patch source = 0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch + source = 0007-service-priority.patch + source = 0008-python3-firmware.patch + source = 0009-python3-nslink.patch md5sums = b59906d80268e69a24c211b398ffd10c md5sums = e3ffb36acfdd321c919e44d477f0774a md5sums = 581cd5f582ed20c7cf85a4df23a9f78a @@ -38,6 +41,9 @@ pkgbase = nslink md5sums = 4e0c61dc0c5da4c3125db7ac1e481aac md5sums = 93e85c98fd375285887b78f2df44ce01 md5sums = f85645dfe886b57273b475d3c6cd0964 + md5sums = e5692035f047cdec52658f67954c6f4d + md5sums = 8c329cf0f9c90cfd07ba86a4027eec48 + md5sums = e21d8211b2f209ace648340cb5583805 sha256sums = 092859a3c198f8e3f5083a752eab0af74ef71dce59ed503d120792be13cc5fa3 sha256sums = d21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb sha256sums = 5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073 @@ -46,5 +52,8 @@ pkgbase = nslink sha256sums = a48cdf948f907b00919c3a2dadbaa2c41c28891d689195e072765c39b0b4af49 sha256sums = 12c55d7b898b5cdcd09d6927fef1585a702fde356e8e039e7e85bbce64f3eed8 sha256sums = 364a4fb9d8695067ee8d235d7763c59f6df417937b901a1810e00d397db21aee + sha256sums = bfa34783131c52e0bc0645c76469aaf504b13ac16d57b02d5ea9002603fb583e + sha256sums = 1353bc403b56ef0b00f4b87826991812ee24bcc9a0b2612c0027317a7aa86736 + sha256sums = a84e1a9884580917afe55816b4ec9b44ec0f4977144e7f4325647ff58642ecd6 pkgname = nslink diff --git a/0007-service-priority.patch b/0007-service-priority.patch new file mode 100644 index 000000000000..a0d5c4269fcc --- /dev/null +++ b/0007-service-priority.patch @@ -0,0 +1,30 @@ +diff -pNaru5 a/nslink.service b/nslink.service +--- a/nslink.service 2014-08-12 12:47:41.000000000 -0400 ++++ b/nslink.service 2022-02-08 13:11:11.754490452 -0500 +@@ -4,10 +4,11 @@ Wants=network-online.target + After=network-online.target + After=syslog.target + + [Service] + ++Nice=-10 + Type=forking + PIDFile=/var/run/nslinkd.pid + ExecStartPre=/sbin/modprobe nslink + ExecStart=/sbin/nslinkd + ExecStopPost=/sbin/rmmod nslink +diff -pNaru5 a/nslink.service.run b/nslink.service.run +--- a/nslink.service.run 2020-11-11 16:28:03.000000000 -0500 ++++ b/nslink.service.run 2022-02-08 13:11:17.474526280 -0500 +@@ -4,10 +4,11 @@ Wants=network-online.target + After=network-online.target + After=syslog.target + + [Service] + ++Nice=-10 + Type=forking + PIDFile=/run/nslinkd.pid + ExecStartPre=/sbin/modprobe nslink + ExecStart=/sbin/nslinkd + ExecStopPost=/sbin/rmmod nslink diff --git a/0008-python3-firmware.patch b/0008-python3-firmware.patch new file mode 100644 index 000000000000..85626947aa89 --- /dev/null +++ b/0008-python3-firmware.patch @@ -0,0 +1,199 @@ +diff -pNaru5 a/DM-Firmware-Updater.py b/DM-Firmware-Updater.py +--- a/DM-Firmware-Updater.py 2022-09-25 23:06:30.913939525 -0400 ++++ b/DM-Firmware-Updater.py 2022-09-25 23:07:09.284353072 -0400 +@@ -11,21 +11,23 @@ def getVersionString(s): + resp = s.recv(1024) + fmt = ">LLLLLL64s6sLBBHBBBB" + devIpAddr, defRoute, srvIpAddr, ipMask, availMemAddr, availMemLength, version, macAddr, \ + modelId, archId, numPorts, progId, boardRev, bootRevMajor, bootRevMinor, numApps \ + = struct.unpack(fmt,resp[:struct.calcsize(fmt)]) ++ if sys.hexversion >= 0x030000F0: ++ version=version.decode() # byte array to string array + return version[:version.index('\x00')] + +-def getArch((host,port),useIPv6=0): ++def getArch(hostport,useIPv6=0): + + if useIPv6: + s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + else: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(15) + try: +- s.connect((host,port)) ++ s.connect(hostport) + except socket.timeout: + return "network connection timeout"; + except (OSError, socket.error) as e: + return "Error opening connection: " + str(e) + +@@ -40,26 +42,31 @@ def getArch((host,port),useIPv6=0): + except socket.timeout: + return "network connection timeout"; + except (OSError, socket.error) as e: + return "error requesting device ID info: " + str(e) + +- return ord(resp[98]) ++ if sys.hexversion >= 0x030000F0: ++ #print(resp[98]) # 3 for me ++ return resp[98] # python3 byte array ++ else: ++ #print(ord(resp[98])) # 3 for me ++ return ord(resp[98]) # python2 str array + + + # return error message if failure otherwise return None +-def uploadFile((host,port),filedata,doreset,callback,useIPv6=0): ++def uploadFile(hostport,filedata,doreset,callback,useIPv6=0): + filesize = len(filedata) + + if doreset: + if useIPv6: + s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + else: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + callback(0,"opening connection") + s.settimeout(15) + try: +- s.connect((host,port)) ++ s.connect(hostport) + except socket.timeout: + return("network connection timeout"); + except (OSError, socket.error) as e: + return "Error opening connection: " + str(e) + callback(0,"sending reset command") +@@ -69,11 +76,11 @@ def uploadFile((host,port),filedata,dore + except socket.timeout: + return("timeout sending reset command"); + except (OSError, socket.error) as e: + return "Error sending reset command: " + str(e) + # wait 3 seconds for the unit to reset and come back up +- for i in xrange(6): ++ for i in range(6): + time.sleep(0.5) + callback((filesize*i)/6) + callback(filesize) + + if useIPv6: +@@ -81,11 +88,11 @@ def uploadFile((host,port),filedata,dore + else: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + callback(0,"opening connection") + s.settimeout(15) + try: +- s.connect((host,port)) ++ s.connect(hostport) + except socket.timeout: + return("Timeout opening connection"); + except (OSError, socket.error) as e: + return "Error opening connection: " + str(e) + +@@ -126,10 +133,11 @@ def uploadFile((host,port),filedata,dore + + if sys.hexversion >= 0x030000F0: + from tkinter import * + from tkinter.ttk import * + import tkinter.filedialog as filedialog ++ import tkinter.messagebox as messagebox + else: + from Tkinter import * + from ttk import * + import tkFileDialog as filedialog + import tkMessageBox as messagebox +diff -pNaru5 a/dmupdate.py b/dmupdate.py +--- a/dmupdate.py 2022-09-25 23:06:30.923939633 -0400 ++++ b/dmupdate.py 2022-09-25 23:06:33.043962526 -0400 +@@ -77,11 +77,11 @@ def getIdentReply(s): + s.send(struct.pack("<BBHL",cmd,index,length,addr)) + resp = s.recv(1024) + signal.alarm(0) + + if verbose>1: +- print "[%d] %s" % (len(resp),toHex(resp)) ++ print("[%d] %s" % (len(resp),toHex(resp))) + + return resp + + def getArch(hostName): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +@@ -137,33 +137,33 @@ def isRedBoot(s,verbose=False): + edata = remaining[:elen] + remaining = remaining[elen:] + extData.append((etype,elen,edata)) + + if verbose: +- print "%15s: %s" % ("devIpAddr",fmtIP(devIpAddr)) +- print "%15s: %s" % ("defRoute",fmtIP(defRoute)) +- print "%15s: %s" % ("srvIpAddr",fmtIP(srvIpAddr)) +- print "%15s: %s" % ("ipMask",fmtIP(ipMask)) +- print "%15s: %s" % ("availMemAddr",hex(availMemAddr)) +- print "%15s: %s" % ("availMemLength",hex(availMemLength)) ++ print("%15s: %s" % ("devIpAddr",fmtIP(devIpAddr))) ++ print("%15s: %s" % ("defRoute",fmtIP(defRoute))) ++ print("%15s: %s" % ("srvIpAddr",fmtIP(srvIpAddr))) ++ print("%15s: %s" % ("ipMask",fmtIP(ipMask))) ++ print("%15s: %s" % ("availMemAddr",hex(availMemAddr))) ++ print("%15s: %s" % ("availMemLength",hex(availMemLength))) + if verbose>1: +- print "%15s: %s" % ("version",repr(version)) ++ print("%15s: %s" % ("version",repr(version))) + else: +- print "%15s: %s" % ("version",version[:version.index('\x00')]) # ignore trailing NULs +- print "%15s: %s" % ("macAddr", macToStr(macAddr)) +- print "%15s: %s" % ("modelId",modelId) +- print "%15s: %s" % ("archId",archId) +- print "%15s: %s" % ("numPorts",numPorts) +- print "%15s: %s" % ("progId",progId) +- print "%15s: %s" % ("boardRev",boardRev) +- print "%15s: %s" % ("bootRevMajor",bootRevMajor) +- print "%15s: %s" % ("bootRevMinor",bootRevMinor) +- print "%15s: %s" % ("numApps",numApps) +- print "%15s: %s" % ("appRecords",appRecords) +- print "%15s: %s" % ("numUserBytes",numUserBytes) +- print "%15s: %s" % ("appEnables",hex(appEnables)) +- print "%15s:" % ("extData:") ++ print("%15s: %s" % ("version",version[:version.index('\x00')])) # ignore trailing NULs ++ print("%15s: %s" % ("macAddr", macToStr(macAddr))) ++ print("%15s: %s" % ("modelId",modelId)) ++ print("%15s: %s" % ("archId",archId)) ++ print("%15s: %s" % ("numPorts",numPorts)) ++ print("%15s: %s" % ("progId",progId)) ++ print("%15s: %s" % ("boardRev",boardRev)) ++ print("%15s: %s" % ("bootRevMajor",bootRevMajor)) ++ print("%15s: %s" % ("bootRevMinor",bootRevMinor)) ++ print("%15s: %s" % ("numApps",numApps)) ++ print("%15s: %s" % ("appRecords",appRecords)) ++ print("%15s: %s" % ("numUserBytes",numUserBytes)) ++ print("%15s: %s" % ("appEnables",hex(appEnables))) ++ print("%15s:" % ("extData:")) + for e in extData: + descr = " type:%d len:%d data: %s" % (e[0],e[1],toHex(e[2])) + if e[0] == 2: + descr += " -- " + decodeFeatureBits(ord(e[2][0])) + elif e[0] == 3: +@@ -172,11 +172,11 @@ def isRedBoot(s,verbose=False): + descr += " -- ipv6 mode" + elif e[0] == 5: + descr += " -- ipv4 configured address" + elif e[0] == 6: + descr += " -- ipv6 current address" +- print descr ++ print(descr) + + return version.startswith("Bootloader") and (progId == 0) + + + def downloadFile(hostName,fileobj,go=0,quiet=0,skip=0,base=0,entry=None,verify_redboot=0): +@@ -188,11 +188,11 @@ def downloadFile(hostName,fileobj,go=0,q + isrb = isRedBoot(s,verbose) + + alarm(0) + + if verify_redboot and not isrb: +- print "Failed to re-connect to RedBoot, found running application." ++ print("Failed to re-connect to RedBoot, found running application.") + sys.exit(1) + + bytecount = len(fileobj.read(skip)) + index = 0 + while 1: diff --git a/0009-python3-nslink.patch b/0009-python3-nslink.patch new file mode 100644 index 000000000000..9c33369bbd24 --- /dev/null +++ b/0009-python3-nslink.patch @@ -0,0 +1,45 @@ +diff -pNaru5 a/nslinkrelease.py b/nslinkrelease.py +--- a/nslinkrelease.py 2008-04-17 09:58:04.000000000 -0400 ++++ b/nslinkrelease.py 2022-09-25 21:07:39.447831425 -0400 +@@ -1,13 +1,13 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python + # needs Python 2.0 or newer + import sys + import os,stat,fcntl + import socket,select + import struct + import re +-import commands ++import subprocess + + def toHex(s): + return " ".join([("%02x" % ord(c)) for c in s]) + + def lookupMajor(driverName): +@@ -67,11 +67,11 @@ def devRelease(devName): + s = os.stat(devName) + if not stat.S_ISCHR(s[stat.ST_MODE]): + msg = "devRelease: '%s' is not char device" % devName + raise msg + # os.stat() dosn't return the dev type, so use /usr/sbin/stat +- s,o = commands.getstatusoutput("stat "+devName) ++ s,o = subprocess.getstatusoutput("stat "+devName) + if s: + msg = "devRelease: error running /usr/bin/stat: %d" % s + raise msg + r = re.compile("Device type: ([0-9]{1,3}),([0-9]{1,3})") + m = r.search(o) +@@ -81,11 +81,11 @@ def devRelease(devName): + minor = int(m.group(2)) + if major != lookupMajor("ttySI"): + raise "not nslink device" + ctlmajor = lookupMajor("NSLinkctl") + t = os.tempnam(None,".nslnkctl") +- s,o = commands.getstatusoutput("mknod --mode=600 %s c %d %d" % (t,ctlmajor,0)) ++ s,o = subprocess.getstatusoutput("mknod --mode=600 %s c %d %d" % (t,ctlmajor,0)) + if s: + msg = "error running mknod : %s" % o + raise msg + fd = os.open(t,os.O_RDONLY) + os.unlink(t) @@ -25,14 +25,14 @@ _opt_defaultmode='660' # default: 620 set -u pkgname='nslink' pkgver='8.00' -pkgrel='4' +pkgrel='5' pkgdesc='tty driver and firmware update for Comtrol DeviceMaster, RTS, LT, PRO, 500, UP, RPSH-SI, RPSH, and Serial port Hub console terminal device server' # UP is not explicitly supported by NS-Link, only by the firmware updater. _pkgdescshort="Comtrol DeviceMaster ${pkgname} TTY driver" arch=('i686' 'x86_64') url='http://www.comtrol.com/' license=('GPL') -depends=('glibc' 'openssl' 'python2' 'sed' 'groff' 'tcl' 'tk' 'util-linux') # python is also needed for the firmware updater +depends=('glibc' 'openssl' 'python3' 'sed' 'groff' 'tcl' 'tk' 'util-linux') # python is also needed for the firmware updater optdepends=( 'gksu: NS-Link Manager GUI' ) @@ -53,6 +53,9 @@ source=( '0004-kernel-5.12-tty-low_latency.patch' '0005-kernel-5.14-unsigned-tty-flow-tty.patch' '0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch' + '0007-service-priority.patch' + '0008-python3-firmware.patch' + '0009-python3-nslink.patch' ) md5sums=('b59906d80268e69a24c211b398ffd10c' 'e3ffb36acfdd321c919e44d477f0774a' @@ -61,7 +64,10 @@ md5sums=('b59906d80268e69a24c211b398ffd10c' '7e0659716e30c6e2ff5c16f20aac07be' '4e0c61dc0c5da4c3125db7ac1e481aac' '93e85c98fd375285887b78f2df44ce01' - 'f85645dfe886b57273b475d3c6cd0964') + 'f85645dfe886b57273b475d3c6cd0964' + 'e5692035f047cdec52658f67954c6f4d' + '8c329cf0f9c90cfd07ba86a4027eec48' + 'e21d8211b2f209ace648340cb5583805') sha256sums=('092859a3c198f8e3f5083a752eab0af74ef71dce59ed503d120792be13cc5fa3' 'd21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb' '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073' @@ -69,7 +75,10 @@ sha256sums=('092859a3c198f8e3f5083a752eab0af74ef71dce59ed503d120792be13cc5fa3' '7b7718789a4a23c3f16094f93b9fc0d8a5915e67e6a0aedef17cdb6adb22a1ac' 'a48cdf948f907b00919c3a2dadbaa2c41c28891d689195e072765c39b0b4af49' '12c55d7b898b5cdcd09d6927fef1585a702fde356e8e039e7e85bbce64f3eed8' - '364a4fb9d8695067ee8d235d7763c59f6df417937b901a1810e00d397db21aee') + '364a4fb9d8695067ee8d235d7763c59f6df417937b901a1810e00d397db21aee' + 'bfa34783131c52e0bc0645c76469aaf504b13ac16d57b02d5ea9002603fb583e' + '1353bc403b56ef0b00f4b87826991812ee24bcc9a0b2612c0027317a7aa86736' + 'a84e1a9884580917afe55816b4ec9b44ec0f4977144e7f4325647ff58642ecd6') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -97,28 +106,40 @@ prepare() { #cp -p nslink.c{,.orig}; false #diff -pNau5 nslink.c{.orig,} > '0002-kernel-5.6-proc_dir_entry-proc_ops.patch' - #patch -Nbup0 -i "${srcdir}/0002-kernel-5.6-proc_dir_entry-proc_ops.patch" + #patch -Nup0 -i "${srcdir}/0002-kernel-5.6-proc_dir_entry-proc_ops.patch" #cp -p nslink.c{,.orig}; false #diff -pNau5 nslink.c{.orig,} > '0003-tty_unregister_driver-void.patch' - patch -Nbup0 -i "${srcdir}/0003-tty_unregister_driver-void.patch" + patch -Nup0 -i "${srcdir}/0003-tty_unregister_driver-void.patch" #cp -p nslink.c{,.orig}; false #diff -pNau5 nslink.c{.orig,} > '0004-kernel-5.12-tty-low_latency.patch' - patch -Nbup0 -i "${srcdir}/0004-kernel-5.12-tty-low_latency.patch" + patch -Nup0 -i "${srcdir}/0004-kernel-5.12-tty-low_latency.patch" # tty.stopped https://lore.kernel.org/lkml/20210505091928.22010-13-jslaby@suse.cz/ # unsigned write_room https://www.spinics.net/lists/linux-serial/msg42297.html # unsigned chars_in_buffer https://www.spinics.net/lists/linux-serial/msg42299.html #cp -p nslink.c{,.orig}; false #diff -pNau5 nslink.c{.orig,} > '0005-kernel-5.14-unsigned-tty-flow-tty.patch' - patch -Nbup0 -i "${srcdir}/0005-kernel-5.14-unsigned-tty-flow-tty.patch" + patch -Nup0 -i "${srcdir}/0005-kernel-5.14-unsigned-tty-flow-tty.patch" # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08799.html [PATCH 5/8] tty: drop alloc_tty_driver # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08801.html [PATCH 7/8] tty: drop put_tty_driver #rm -f *.orig; cp -p nslink.c{,.orig}; false #diff -pNau5 nslink.c{.orig,} > '0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch' - patch -Nbup0 -i "${srcdir}/0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch" + patch -Nup0 -i "${srcdir}/0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch" + + #rm -f *.orig; cp -p nslink.service{,.orig}; false + #diff -pNau5 nslink.service{.orig,} > '0007-service-priority.patch' + #patch -Nup0 -i "${srcdir}/0007-service-priority.patch" + + #rm -f *.orig; cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0007-service-priority.patch' + patch -Nup1 -i "${srcdir}/0007-service-priority.patch" + + #rm -f *.orig; cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0009-python3-nslink.patch' + patch -Nup1 -i "${srcdir}/0009-python3-nslink.patch" # Make package compatible #cp -p 'install.sh' 'install.sh.Arch' # testmode for diff comparison @@ -150,8 +171,8 @@ prepare() { # Switch to python2 sed -e '# Why using local on just this one?' \ - -e 's:/usr/local/bin/python:/usr/bin/python:g' \ - -e 's:/usr/bin/python:&2:g' \ + -e '#s:/usr/local/bin/python:/usr/bin/python:g' \ + -e '#s:/usr/bin/python:&2:g' \ -i *.py 'nslinktool' # Branding in dmesg @@ -190,12 +211,16 @@ prepare() { sed -e '# Cosmetic cleanup for simpler patch editing, trim space at eol' \ -e 's:\s\+$::g' \ -e '# Switch to python2' \ - -e 's:/usr/bin/python:&2:g' \ + -e '#s:/usr/bin/python:&2:g' \ -i *.py + #rm -f *.orig; cd '..'; cp -pr 'DM-Firmware-Updater-1.06' 'a'; ln -s 'DM-Firmware-Updater-1.06' 'b'; false + #diff -pNaru5 'a' 'b' > '0008-python3-firmware.patch' + patch -Nup1 -i "${srcdir}/0008-python3-firmware.patch" + # Patch usage and help into command line tool #diff -pNau5 dmupdate.py{.orig,} > '../dmupdate.py.usage.patch' - patch -Nbup0 -i "${srcdir}/dmupdate.py.usage.patch" + patch -Nup0 -i "${srcdir}/dmupdate.py.usage.patch" set +u } |