diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 149 |
1 files changed, 128 insertions, 21 deletions
@@ -3,12 +3,15 @@ _opt_DKMS=1 # This can be toggled between installs _opt_defaultmode='660' # default: 620 +#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/5.10.*/modules.alias))" + # Todo: Test secure mode # Todo: python tools should be updated to python3 # Todo: nslinktool Config Driver needs an up down button to reorder entries # Todo: TUI firmware updater. # Todo: Firmware updater can't update unit set to DHCP. +# Todo: Firmware updater errors out on old versions: Expected to connect to bootloader after reboot but found DeviceMaster Boot Version 1.20 # Todo: Comtrol icons for nslinktool and the firmware updater # Todo: nslinktool set the mouse pointer to a spinning circle far too long after startup # Todo: rm /dev/ttySI* on rmmod nslink @@ -23,15 +26,15 @@ _opt_defaultmode='660' # default: 620 set -u pkgname='nslink' -pkgver='7.34' -pkgrel='1' +pkgver='8.00' +pkgrel='7' 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' ) @@ -43,15 +46,53 @@ _srcdir="devicemaster-linux-${pkgver}" _srcdir2='DM-Firmware-Updater-1.06' # http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_pvdx2.htm source=( #"ftp://ftp.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz" - #"http://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz" - "http://downloads.comtrol.com/beta/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz" + "https://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz" #'ftp://ftp.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz' - 'http://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz' + 'https://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz' 'dmupdate.py.usage.patch' + '0002-kernel-5.6-proc_dir_entry-proc_ops.patch' + '0003-tty_unregister_driver-void.patch' + '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' + '0010-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch' + '0011-kernel-6.0-set_termios-const-ktermios.patch' + '0012-kernel-6.6-struct-tty_operations-write-size_t.patch' + '0013-kernel-6.3-tty_port_operations-int-to-bool.patch' ) -sha256sums=('4434d75078db4c4d8406fc3013bd76dbac2d11133062de9ee1cfff4db533773b' +md5sums=('b59906d80268e69a24c211b398ffd10c' + 'e3ffb36acfdd321c919e44d477f0774a' + '581cd5f582ed20c7cf85a4df23a9f78a' + '36fcfa504772df4aabbde9f23d5459d5' + '7e0659716e30c6e2ff5c16f20aac07be' + '4e0c61dc0c5da4c3125db7ac1e481aac' + '93e85c98fd375285887b78f2df44ce01' + 'f85645dfe886b57273b475d3c6cd0964' + 'e5692035f047cdec52658f67954c6f4d' + '8c329cf0f9c90cfd07ba86a4027eec48' + 'e21d8211b2f209ace648340cb5583805' + '2774e3aa64717a7613e96fd86f649ea1' + '98788ff1378604e9fda43eb6ef9e9e3d' + 'feb1ccc7522a6ac2b33326c7f648edb2' + '1ff77ae8edbcd654c680999eadd4911b') +sha256sums=('092859a3c198f8e3f5083a752eab0af74ef71dce59ed503d120792be13cc5fa3' 'd21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb' - '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073') + '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073' + 'cbaa55f16357688b992a7d7c0f2fb56225edda286d97595918c50e05005d1318' + '7b7718789a4a23c3f16094f93b9fc0d8a5915e67e6a0aedef17cdb6adb22a1ac' + 'a48cdf948f907b00919c3a2dadbaa2c41c28891d689195e072765c39b0b4af49' + '12c55d7b898b5cdcd09d6927fef1585a702fde356e8e039e7e85bbce64f3eed8' + '364a4fb9d8695067ee8d235d7763c59f6df417937b901a1810e00d397db21aee' + 'bfa34783131c52e0bc0645c76469aaf504b13ac16d57b02d5ea9002603fb583e' + '1353bc403b56ef0b00f4b87826991812ee24bcc9a0b2612c0027317a7aa86736' + 'a84e1a9884580917afe55816b4ec9b44ec0f4977144e7f4325647ff58642ecd6' + '2b909997f0662ae9a49463be4c1ef2af718882924071e0d74b9c04d9d1198691' + '7f181d1542b542989b319caf85621725389d7681cf2d5c3bb57dc774d14f1b76' + '5a62d3658d716c8140de65c2ac2e2560ca33f0f2a58212e29df74eadb821b6ce' + '4c605df9b08ea2be3b3c94a2dab8554902ff15576a7075c597453306c275e3e2') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -77,6 +118,60 @@ prepare() { fi unset _ver + #cp -p nslink.c{,.orig}; false + #diff -pNau5 nslink.c{.orig,} > '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 -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 -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 -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 -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" + + #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0010-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch' + patch -Nup1 -i "${srcdir}/0010-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch" + + # https://lore.kernel.org/linux-arm-kernel/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com/T/ + #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0011-kernel-6.0-set_termios-const-ktermios.patch' + patch -Nup1 -i "${srcdir}/0011-kernel-6.0-set_termios-const-ktermios.patch" + + #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0012-kernel-6.6-struct-tty_operations-write-size_t.patch' + patch -Nup1 -i "${srcdir}/0012-kernel-6.6-struct-tty_operations-write-size_t.patch" + + #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false + # diff -pNaru5 'a' 'b' > '0013-kernel-6.3-tty_port_operations-int-to-bool.patch' + patch -Nup1 -i "${srcdir}/0013-kernel-6.3-tty_port_operations-int-to-bool.patch" + # Make package compatible #cp -p 'install.sh' 'install.sh.Arch' # testmode for diff comparison sed -e '# Fix some paths' \ @@ -102,10 +197,13 @@ prepare() { -i 'install.sh' test ! -s 'install.sh.Arch' || echo "${}" + # Fix /var/run + sed -e 's:/var/run/:/run/:g' -i 'nslink.service' + # 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 @@ -122,7 +220,19 @@ prepare() { sed -e 's:^[^#]:#&:g' -i 'nslink.conf' # Fix makefile - sed -e 's:=/lib/modules:=/usr/lib/modules:g' -i 'Makefile' + #cp -p 'Makefile'{,.Arch} + sed -e 's:=/lib/modules:=/usr/lib/modules:g' \ + -e '# Switch SUBDIRS= to M= for Kernel 5.4' \ + -e 's:SUBDIRS=:M=: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 's:`uname -r`:$(KERNELRELEASE):g' \ + -e '#s:$(KVER):$(KERNELRELEASE):g' \ + -e '# Shift make executable to separate target' \ + -e 's@^\tmake nslinkd@\nnslink:\n&@g' \ + -e '1i KERNELRELEASE?=$(shell uname -r)' \ + -i 'Makefile' + test ! -s 'Makefile.Arch' # Correct group and chmod for serial sed -e '/getgrnam/ s:"tty":"uucp":g' \ @@ -141,12 +251,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 } @@ -154,7 +268,7 @@ build() { set -u cd "${_srcdir}" set +u - if ! make -s -j1 QUIET=0; then + if ! make -j1 QUIET=0 all nslink; then warning 'a no such file or directory error means you need to reboot to load the updated kernel' false fi @@ -231,13 +345,6 @@ EOF ) "${_dkms}/dkms.conf" install -Dpm644 'nslink.h' 'nslink_int.h' 'version.h' 'nslink.c' 'Makefile' -t "${_dkms}" #make -C "${_dkms}" clean - 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 's:`uname -r`:$(KERNELRELEASE):g' \ - -e 's:$(KVER):$(KERNELRELEASE):g' \ - -e '# Get rid of make lines so make all makes the module' \ - -e 's:^\s\+make\s:#&:g' \ - -i "${_dkms}/Makefile" fi # Install firmware updaters |