diff options
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | 0002-kernel-5.0.0-access_ok.patch | 124 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | npreal2-install.sh | 2 |
4 files changed, 22 insertions, 144 deletions
@@ -1,10 +1,10 @@ # Generated by mksrcinfo v8 -# Tue Dec 3 22:42:13 UTC 2019 +# Wed Dec 4 04:03:22 UTC 2019 pkgbase = npreal2 pkgdesc = real tty driver for Moxa NPort serial console terminal server - pkgver = 1.19 - pkgrel = 2 - url = https://www.moxa.com/support/sarch_result.aspx?type=soft&prod_id=237&type_id=9 + pkgver = 5.0 + pkgrel = 1 + url = https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/terminal-servers/nport-6100-6200-series install = npreal2-install.sh arch = i686 arch = x86_64 @@ -19,14 +19,12 @@ pkgbase = npreal2 depends = dkms depends = linux-headers backup = etc/npreal2/npreal2d.cf - source = https://www.moxa.com/drivers/IDC_SW/DeviceServer/Driver/NPort%20Real%20TTY%20Driver%20for%20Linux/Mainline/ver1.19/npreal2_mainline_v1.19_build_17110917.tgz + source = https://www.moxa.com/Moxa/media/PDIM/S100000217/moxa-real-tty-drivers-for-linux-5.x.x-driver-v5.0.tgz source = npreal2.sh source = 0001-mxmknod-folder-fix-and-chgrp-uucp.patch - source = 0002-kernel-5.0.0-access_ok.patch - sha256sums = f99f38ef5618469a1d6f4824e41856616ee65ab8359069daa70d8d481f364462 + sha256sums = 33da5d4b1ff9853e9d58c7905f1fdf09a3e284658f42437210155c4c913f4dad sha256sums = 7241767fa8dead2dbe4cf4db32d39f5cf9d95b08f60daf79822ae306727af372 sha256sums = 7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605 - sha256sums = 211f3b0ba50452bfe6d39076eb1a60a7557dd038288fb8dcd4374886f4c2844e pkgname = npreal2 diff --git a/0002-kernel-5.0.0-access_ok.patch b/0002-kernel-5.0.0-access_ok.patch deleted file mode 100644 index c65bdc457d2e..000000000000 --- a/0002-kernel-5.0.0-access_ok.patch +++ /dev/null @@ -1,124 +0,0 @@ ---- npreal2.c.orig 2017-11-10 02:25:03.000000000 -0500 -+++ npreal2.c 2019-03-10 21:28:04.465949059 -0400 -@@ -1317,19 +1317,25 @@ static int npreal_ioctl(struct tty_struc - return(retval); - tty_wait_until_sent(tty, 0); - npreal_send_break(info, arg ? arg*(HZ/10) : HZ/4); - return(0); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) -+#define compat_access_ok(u,v,w) access_ok(v,w) -+#else -+#define compat_access_ok(u,v,w) access_ok(u,v,w) -+#endif -+ - case TIOCGSOFTCAR: -- error = access_ok(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT; -+ error = compat_access_ok(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT; - if ( error ) - return(error); - put_to_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg); - return 0; - - case TIOCSSOFTCAR: -- error = access_ok(VERIFY_READ, (void *)arg, sizeof(long))?0:-EFAULT; -+ error = compat_access_ok(VERIFY_READ, (void *)arg, sizeof(long))?0:-EFAULT; - if ( error ) - return(error); - get_from_user(templ,(unsigned long *)arg); - arg = templ; - #if (LINUX_VERSION_CODE < VERSION_CODE(3,7,0)) -@@ -1340,25 +1346,25 @@ static int npreal_ioctl(struct tty_struc - (arg ? CLOCAL : 0)); - #endif - return(0); - - case TIOCGSERIAL: -- error = access_ok(VERIFY_WRITE, (void *)arg, -+ error = compat_access_ok(VERIFY_WRITE, (void *)arg, - sizeof(struct serial_struct))?0:-EFAULT; - if ( error ) - return(error); - return(npreal_get_serial_info(info, (struct serial_struct *)arg)); - - case TIOCSSERIAL: -- error = access_ok(VERIFY_READ, (void *)arg, -+ error = compat_access_ok(VERIFY_READ, (void *)arg, - sizeof(struct serial_struct))?0:-EFAULT; - if ( error ) - return(error); - return(npreal_set_serial_info(info, (struct serial_struct *)arg)); - - case TIOCSERGETLSR: /* Get line status register */ -- error = access_ok(VERIFY_WRITE, (void *)arg, -+ error = compat_access_ok(VERIFY_WRITE, (void *)arg, - sizeof(unsigned int))?0:-EFAULT; - if ( error ) - return(error); - else - return(npreal_get_lsr_info(info, (unsigned int *)arg)); -@@ -1411,11 +1417,11 @@ static int npreal_ioctl(struct tty_struc - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: -- error = access_ok(VERIFY_WRITE, (void *)arg, -+ error = compat_access_ok(VERIFY_WRITE, (void *)arg, - sizeof(struct serial_icounter_struct))?0:-EFAULT; - if ( error ) - return(error); - cnow = info->icount; - p_cuser = (struct serial_icounter_struct *)arg; -@@ -3369,11 +3375,11 @@ npreal_net_ioctl ( - } - if (nd->flag & NPREAL_NET_DO_SESSION_RECOVERY) - len = nd->do_session_recovery_len; - else - len = (int)nd->cmd_buffer[2] + 3; -- rtn = access_ok( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT; -+ rtn = compat_access_ok( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT; - if ( rtn ) - { - goto done; - } - if (copy_to_user( (void *)arg, (void *)nd->cmd_buffer,len )) -@@ -3393,11 +3399,11 @@ npreal_net_ioctl ( - if (size < 2) - goto done; - if (size > 84) - size = 84; - -- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; -+ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; - if ( rtn ) - { - goto done; - } - if (copy_from_user( (void *)rsp_buffer, (void *)arg,size)) -@@ -3518,11 +3524,11 @@ npreal_net_ioctl ( - int status; - - if (size != sizeof (status)) - goto done; - -- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; -+ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; - if ( rtn ) - { - goto done; - } - status = (nd->flag & NPREAL_NET_TTY_INUSED) ? 1 : 0; -@@ -3543,11 +3549,11 @@ npreal_net_ioctl ( - break; - - if (size != sizeof (struct server_setting_struct)) - goto done; - -- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; -+ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; - if ( rtn ) - { - goto done; - } - if (copy_from_user( (void *)&settings, (void *)arg,size)) @@ -80,12 +80,12 @@ _opt_defaultmode='666' # default: 666 set -u pkgname='npreal2' #pkgver='1.18.49'; _commit='6d9ef0dbafd487595c4f5e4e5e64c1faba98d060' -pkgver='1.19'; _build='17110917' -pkgrel='2' +pkgver='5.0'; # _build='17110917' +pkgrel='1' pkgdesc='real tty driver for Moxa NPort serial console terminal server' _pkgdescshort="Moxa NPort ${pkgname} TTY driver" arch=('i686' 'x86_64') -url='https://www.moxa.com/support/sarch_result.aspx?type=soft&prod_id=237&type_id=9' # Moxa NPort 5110 +url='https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/terminal-servers/nport-6100-6200-series' #url="https://github.com/rchovan/${pkgname}" license=('GPL' 'custom') depends=('glibc' 'gawk' 'perl' 'psmisc' 'openssl') @@ -93,7 +93,8 @@ depends=('glibc' 'gawk' 'perl' 'psmisc' 'openssl') backup=("etc/npreal2/npreal2d.cf") install="${pkgname}-install.sh" _srcdir='moxa' -source=("https://www.moxa.com/drivers/IDC_SW/DeviceServer/Driver/NPort%20Real%20TTY%20Driver%20for%20Linux/Mainline/ver${pkgver}/npreal2_mainline_v${pkgver}_build_${_build}.tgz") +#source=("https://www.moxa.com/drivers/IDC_SW/DeviceServer/Driver/NPort%20Real%20TTY%20Driver%20for%20Linux/Mainline/ver${pkgver}/npreal2_mainline_v${pkgver}_build_${_build}.tgz") +source=("https://www.moxa.com/Moxa/media/PDIM/S100000217/moxa-real-tty-drivers-for-linux-5.x.x-driver-v${pkgver}.tgz") #_srcdir="${pkgname}" #source=("git+${url}.git#commit=${_commit}") #_srcdir="${pkgname}-${_commit}" @@ -102,13 +103,12 @@ source+=('npreal2.sh') _patches=( #'0000-SSL-destroy-cf-configuration.patch' '0001-mxmknod-folder-fix-and-chgrp-uucp.patch' - '0002-kernel-5.0.0-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418 + # '0002-kernel-5.0.0-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418 ) source+=("${_patches[@]}") -sha256sums=('f99f38ef5618469a1d6f4824e41856616ee65ab8359069daa70d8d481f364462' +sha256sums=('33da5d4b1ff9853e9d58c7905f1fdf09a3e284658f42437210155c4c913f4dad' '7241767fa8dead2dbe4cf4db32d39f5cf9d95b08f60daf79822ae306727af372' - '7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605' - '211f3b0ba50452bfe6d39076eb1a60a7557dd038288fb8dcd4374886f4c2844e') + '7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -144,8 +144,8 @@ prepare() { -e 's: /lib/: /usr/lib/:g' \ -e '# Cut some of the warnings we dont want to fix' \ -e '#s:^CC+=.*$:& -Wno-misleading-indentation:g' \ - -e '# Switch SUBDIRS= to M= for Kernel 5.4' \ - -e 's:SUBDIRS=:M=$(PWD) &:g' \ + -e '# Add back SUBDIRS= for dkms detection' \ + -e '/ modules/ s: M=: SUBDIRS=$(PWD)&:g' \ -i 'Makefile' ! test -s 'Makefile.Arch' || echo "${}" @@ -183,6 +183,8 @@ prepare() { -e 's:^LINUX_DIS=:#&:g' \ -e '# Enable SSL' \ -e 's:^read check:check="Y" # &:g' \ + -e '# Disable interactive response to kernel version mismatch' \ + -e 's:^read any:#&:g' \ -i 'mxinst' ! test -s 'mxinst.Arch' || echo "${}" @@ -195,6 +197,8 @@ prepare() { -e '# Move config file in mx utils. Another sed will provide this #define' \ -e '/npreal2d.cf/ s:DRIVERPATH:CONFIGPATH:g' \ -i mx*.c + # force the use of systemd + sed -e 's:^int isinitproc:static int isinitproc() { return 0; }\nstatic &_disabled:g' -i 'mxaddsvr.c' 'mxdelsvr.c' 'mxloadsvr.c' 'mxsetsec.c' sed -e '# Move config file in mx daemons' \ -e '/npreal2d.cf/ s:workpath:"/etc/npreal2":g' \ -e '# Move log file' \ @@ -214,7 +218,7 @@ prepare() { #cp -p 'npreal2.c'{,.orig}; false #diff -pNau5 'npreal2.c'{.orig,} > '0002-kernel-5.0.0-access_ok.patch' - patch -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-access_ok.patch" + #patch -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-access_ok.patch" # Apply PKGBUILD options sed -e 's:^\(ttymajor\)=.*:'"\1=${_opt_ttymajor}:g" \ diff --git a/npreal2-install.sh b/npreal2-install.sh index e391e1d948ce..f8ce48dcf149 100644 --- a/npreal2-install.sh +++ b/npreal2-install.sh @@ -1,6 +1,6 @@ _tp_config="/etc/npreal2/npreal2d.cf" _tp_configps="${_tp_config}.pacsave" -_tp_log='/var/log/npreal2d.log' +#_tp_log='/var/log/npreal2d.log' post_upgrade() { set -u |