sunix-snx
maintainer severach
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The source is a driver from the official Sunix website, hosted on a non-whitelisted but plausibly legitimate domain; it is a standard kernel module build with no evidence of malicious behavior or unverifiable prebuilt binaries.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The source is a driver from the official Sunix website, hosted on a non-whitelisted but plausibly legitimate domain; it is a standard kernel module build with no evidence of malicious behavior or unverifiable prebuilt binaries.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
source=() URL on a non-standard host
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:116
"http://www.sunix.com/en/download.php?file=driver&file_link=download/driver/${_dl}_snx_V${pkgver//_/.}.zip"
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
2
3
_opt_DKMS=1 # This can be toggled between installs
4
5
#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/6.12.*/vmlinuz))"
6
7
# Todo: Unable to trigger timer to see if it works
8
# Todo: modprobe snx with conflicting major, again modeprobe snx crashes kernel
9
10
# ls -l /dev/ttySNX*
11
# lsmod | grep snx
12
# lspci -v | grep -A4 -i snx
13
# dmesg | grep -A8 -i snx
14
15
# Sunix states that the following are not errors and part of normal operation.
16
17
#[ 126.093932] SNX Info : Loading SUNIX Multi-I/O Board Driver Module
18
#[ 126.093934] -- Date : 2016/06/20
19
#[ 126.093935] -- Version : V2.0.4.2
20
#[ 126.094474] SNX Info : Found SUNIX 5069 Series Board (1S1P),
21
#[ 126.094475] bus number:5, device number:0
22
#[ 126.094485] Trying to free nonexistent resource <000000000000c020-000000000000c027>
23
#[ 126.094487] Trying to free nonexistent resource <000000000000c050-000000000000c057>
24
#[ 126.094489] Trying to free nonexistent resource <000000000000c050-000000000000c052>
25
#[ 126.094490] Trying to free nonexistent resource <000000000000c053-000000000000c057>
26
#[ 126.094491] Trying to free nonexistent resource <000000000000c040-000000000000c047>
27
#[ 126.094493] Trying to free nonexistent resource <000000000000c040-000000000000c042>
28
#[ 126.094494] Trying to free nonexistent resource <000000000000c043-000000000000c047>
29
#[ 126.094714] SNX Info : parport2 - PC-style at 0xc050 (0xc040)
30
#[ 126.094880] SNX Info : lp2 port using parport2 (polling).
31
#[ 126.094882] ================================================================================
32
33
# From website:
34
# Serial: SER5416H SER5466A AL H HL SER6427A AL SER6437A AL H HL SER6456A AL H HL SER5016H SER5027A AL D DL H HL U UH UL SER5037A AL D H HL U UH UL SER5056A AL H HL U UH UHL UL SER5066A AL H HL U UH UHL UL SER5337A SER5356A SER5366A MCS6456P
35
# Also: SUN1889 SER4037A
36
# Not: ExpressCard ECS1S00
37
# Parallel: PAR5418A AL PAR6408A AL PAR5008A AL R RL PAR5018A AL
38
# Not: SUN1888 PAR4018A
39
# Multi I/O: MIO5499A H MIO6469A AL H HL P PH PHL PL S SH SHL SL MIO6479A AL H HL P PH PHL PL S SH SHL SL MIO4089AM MIO5069A H P PH U UH UL MIO5079A AL H HL U UH UL MIO5099A H
40
# RS422/485: IPC-E2108S SI IPC-E2202LI S SI SL IPC-E2204S SI IPC-E3204S IPC-P2102 L LI SI IPC-P2104 SI IPC-P2108 SI IPC-P2116 IPC-P3104 IPC-P3108 U IPC-B2102 SI IPC-B2104 SI IPC-B2108 SI
41
# Powered COM: DEL2S00PL DEL4S00P MIO6469P PH PHL PL S SH SHL SL MIO6479P PH PHL PL S SH SHL SL SER6427P PH PHL PL SER6437P PH PHL PL S SER6456P PH PHL PL S SH SL MIO5069P PH SER5027P PH PHL PL SER5037P PH PHL PL SER5056P PH PHL PL
42
43
# From README
44
#Maximum 4 boards can be installed in combination(up to 32 serial port and 2 parallel port),
45
#support sunix multi i/o boards as list below.
46
47
#(S - serial port, P - parallel port)
48
49
#Golden series
50
#1S - 4027T 4027A 4027AL 4027D 4027DL 4027P
51
#2S - 4037T 4037A 4037AL 4037D 4037U 4037P 4037PL
52
#4S - 4056A 4056A3 4056A4 4056AL 4056D 4056J 4056U 4056UE 4056P 4056PL 4056PM 4055WN 4056DW 4056AM 4056LM 4056LL 4056JM 4056LV 4000A 4000AL 4000P 4000PL
53
#8S - 4066R 4066U 4066UE 4066WM 4066RM 4066JM 8000A 8000AL
54
#2S1P - 4079AT
55
#2S2P - 4089AM
56
#4S2P - 4096A
57
58
#Matrix series
59
#2S - P1002 P2002
60
#4S - P1004 P2004 P3004
61
#8S - P1008 P2008 P3008
62
#16S - P1016
63
64
#SUN1999 series
65
#1S - 5027A 5027AL 5027H 5027HL 5027P 5027PL 5027PH 5027PHL
66
#2S - 5037A 5037H 5037AL 5037HL 5037P 5037PH 5037PL 5037PHL
67
#4S - 5056A 5056AL 5056H 5056HL 5056P 5056PL 5056PH 5056PHL 5056U 5056UL 5056UH 5056UHL
68
#8S - 5066A 5066H 5066AL 5066HL 5066U 5066UL 5066UH 5066UHL
69
#16S - 5016H
70
#1P - 5008A
71
#1S1P - 5069A 5069H 5069P 5069PH
72
#2S1P - 5079A 5079H 5079AL
73
#4S1P - 5099A 5099H
74
#2S - IPC-P2102 IPC-P2102SI
75
#4S - IPC-P2104 IPC-P2104SI IPC-P3104
76
#8S - IPC-P2108 IPC-P2108SI IPC-P3108
77
#16S -IPC-P2116
78
79
#Cash Drawer
80
#CDK1037A CDK1037P CDK1037H CDK1037L
81
#CDK1056A CDK1056P CDK1056H CDK1056L
82
83
#DIO
84
#DIO0802 DIO1604 DIO3204
85
86
#From OpenSUSE http://rpm.pbone.net/index.php3/stat/4/idpl/33441068/dir/opensuse/com/snx-kmp-pae-2.0.4.0_k4.3.3_6-1.14.i586.rpm.html
87
#Digitus cards:
88
#1S: DCSER1
89
#2S: DCSER2
90
#4S: DCSER4
91
92
set -u
93
# http://netbsd.gw.com/cgi-bin/man-cgi?puc+4+NetBSD-current
94
# https://pkgs.org/download/snx-kmp-default # OpenSUSE
95
# http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Startech
96
pkgname='sunix-snx'
97
#pkgver='2.0.4_2'; _dl='2016/20160706173626'
98
#pkgver='2.0.4_3'; _dl='2017/20171122180114'
99
#pkgver='2.0.5_0'; _dl='2021/20210407180737'
100
#pkgver='2.0.7_0'; _dl='2022/20220531161341'
101
#pkgver='2.0.8_0'; _dl='2023/20230427142706'
102
pkgver='2.1.0_0'; _dl='2024/20241029154956'
103
pkgrel='1'
104
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'
105
arch=('i686' 'x86_64')
106
url='http://www.sunix.com/'
107
#url='http://www.sunix.com.tw/'
108
#url='http://www.sunix.com/en/'
109
#url='http://www.sunixusa.com/'
110
license=('GPL' 'custom')
111
makedepends=('gzip' 'findutils' 'sed' 'diffutils' 'patch')
112
install="${pkgname}-install.sh"
113
_srcdir="snx_V${pkgver//_/.}"
114
source=(
115
# DO NOT switch link to https. It doesn't work.
116
"http://www.sunix.com/en/download.php?file=driver&file_link=download/driver/${_dl}_snx_V${pkgver//_/.}.zip"
117
#"http://www.sunix.com.tw/en/download.php?pid=1479&file=driver&file_link=download/driver/${_dl}_snx_V${pkgver//_/.}.tar.gz"
118
# http://dpdk.org/dev/patchwork/patch/22003/ [dpdk-dev] kni: fix build with kernel 4.11 lib/librte_eal/linuxapp/kni/compat.h lib/librte_eal/linuxapp/kni/kni_dev.h
119
# http://dpdk.org/dev/patchwork/patch/22037/
120
# http://rglinuxtech.com/?p=1930
121
# https://forum.manjaro.org/t/error-with-rtl8812au/24066
122
#'0000-Kernel-4-15-timers.patch'
123
'0001-kernel-4.7-async-initialized.patch'
124
'0002-kernel-5.12-tty-low_latency.patch'
125
'0003-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch'
126
'0004-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
127
'0005-kernel-6.0-set_termios-const-ktermios.patch'
128
'0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch'
129
'0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch'
130
'0008-kernel-6.6-struct-tty_operations-write-size_t.patch'
131
'0009-kernel-6.4-class_create-1arg.patch'
132
'0010-kernel-6.12-no_llseek-NULL.patch'
133
)
134
md5sums=('7e1d89a8bfc47e1fd44e68cbcb1d6de2'
135
'71564d580faaf72ab3518c298883742e'
136
'e3604145fb2b1678da395a600e4cf1ed'
137
'a16e94419d504663c50d3d7522b0c019'
138
'43db33db258f67122c58c3868d688d13'
139
'a2fbf035e4dddf5cab87317223435633'
140
'920cdd39dc868c2d216c23d180d9eb3e'
141
'7e16e1860e93a08a0591be4bfc8ca558'
142
'4b38b409ec2d9aa23b51578587e7033c'
143
'd967f1bf0e7a16a778931223404fd046'
144
'57b5367c7b78c7eaeb3211f93d82ef06')
145
sha256sums=('b8274bfb008a793dab2bb4a79fc2deda10bb064e3478ba8fd8cc1cd7140e4132'
146
'4ea9275ca8122543c25f17112d4c374dc39de32e3d9d1d0aa5488bacd514750d'
147
'ab0ef161b7c7053299b18ab9b697047d37142e9e88d53d40ac087f64522a55dd'
148
'12a9d8f11c60cef0e70d0d5cba684146beb32eef76e7519728e2e4453f671251'
149
'fce8e15188f58fcfbea2720672709ea1e8d9e4703155c1222cf31ababd61807f'
150
'bc1aeab271927cbb62c9c2d2517f535bbd30646d997c99c757ed4b92fd474218'
151
'71d3be91c017166ea523f0f1c7bc5d1e66d828d1de60923b24947be4cb960e01'
152
'6e98100a00af103ac21a7054519296ebc1958f7e15f129199189a63c6de5332c'
153
'628cb175f7b30e74d1c2f3ca78ccb9a9e4301f1d8e8756d25435581959e312a5'
154
'2fedbe6763ce6b7363af62264794fce05ff7bc28e377cc580f697c7b5553df5c'
155
'7cb45c28e543cc3834f6daf2ba2b0a6141b16c1b33846a4ad94b9531a652a534')
156
157
if [ "${_opt_DKMS}" -ne 0 ]; then
158
depends+=('linux' 'dkms' 'linux-headers')
159
else
160
makedepends+=('linux-headers')
161
fi
162
163
_modulename='snx'
164
165
# We can't modify .install but we can stop and force the user to fix it.
166
_install_check() {
167
local _ckvar
168
local _ckline
169
local _pkgname="${pkgname}"
170
for _ckvar in '_pkgname' '_modulename'; do
171
_ckline="${_ckvar}='${!_ckvar}'"
172
if ! grep -q "^${_ckline}"'$' "${startdir}/${install}"; then
173
msg "${install} must be fixed"
174
echo "${_ckline}"
175
set +u
176
false
177
fi
178
done
179
}
180
181
prepare() {
182
set -u
183
_install_check
184
cd "${_srcdir}"
185
186
# Kernel 3,4,5 all use the same makefile. Trim out everything but Kernel 4
187
mv driver/Makefile{,.Arch}
188
sed -n -e '/^# for kernel 4.0/,/^# for kernel 3.0/ p' 'driver/Makefile.Arch' > 'driver/Makefile'
189
sed -e '/findstring 4./ s:^:#:g' -i 'driver/Makefile'
190
rm 'driver/Makefile.Arch'
191
192
# Make package compatible and fix some version problems
193
#cp -p 'driver/Makefile'{,.Arch}
194
sed -e 's: /lib/modules/: /usr/lib/modules/:g' \
195
-e '/^install:/,/^$/ s: /usr/lib/: "${DESTDIR}"/usr/lib/:g' \
196
-e '# New cache folder for gcc 8' \
197
-e 's/^clean.*:$/&\n\trm -f .cache.mk\n\trm -f .Module*\n\trm -f .module*/g' \
198
-e '# What sort of make clean deletes files out of system folders?' \
199
-e '/^clean/,/^$/ s: /usr/lib/: "${DESTDIR}"/usr/lib/:g' \
200
-e '# Prevent file deletion for DKMS' \
201
-e '\:/usr/lib/modules: s:^\s\+rm\s:#&:g' \
202
-e '# Disable depmod '\
203
-e 's:^\s\+depmod :# &:g' \
204
-e '# Dont repeat kernel make on install' \
205
-e 's/install: modules/install: /g' \
206
-e '# Fix bad kernel version matching. 2.6 would match 4.12.6, a version coming up soon' \
207
-e '/findstring / s:findstring\s\+:&=:g ' \
208
-e '/findstring / s:\$(shell uname:=&:g ' \
209
-e '/findstring / s:"\([0-9]\):"=\1:g ' \
210
-e '# 2.6 would match a hostname of rack2.6location5' \
211
-e '/findstring / s:uname -a:uname -r:g ' \
212
-e '# Kernel 5.4 compatible' \
213
-e 's: SUBDIRS=\([^ ]\+\) : M=\1&:g ' \
214
-e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
215
-e 's:shell uname -r:KERNELRELEASE:g' \
216
-e '# DKMS sets KERNELRELEASE which accidentally launches phase 2 of this Makefile' \
217
-e '# Fix by changing the detection var.' \
218
-e '# SUBDIRS makes more sense to me because I can see it in the Makefile!' \
219
-e 's:ifneq ($(KERNELRELEASE),):ifneq ($(SUBDIRS),):g' \
220
-e '1i KERNELRELEASE?=$(shell uname -r)' \
221
-i 'driver/Makefile'
222
sed -e '/^install:/,/^$/ s: /usr/: "${DESTDIR}"/usr/:g' -i 'snxdump/Makefile' 'snxterm/Makefile'
223
! test -s 'driver/Makefile.Arch' || echo "${}"
224
225
# Prevent conflict with /dev/kfd major 242 linux>=4.9. Not present in linux=4.4. linux>4.4 not tested.
226
sed -e '/^#define SNX_[A-Z][A-Z][A-Z]_MAJOR/ s:24:23:g' \
227
-e '# Remove UTF BOM' \
228
-e '1 s:\xEF\xBB\xBF::g' \
229
-i 'driver/snx_common.h'
230
231
sed -e 's:\r$::g' -i $(grep -slrF $'\r')
232
233
find -type 'f' -name '*.ko.unsigned' -delete
234
235
local _patches=()
236
#_patches+=('0000-Kernel-4-15-timers.patch')
237
#_patches+=('0001-kernel-4.7-async-initialized.patch')
238
#_patches+=('0002-kernel-5.12-tty-low_latency.patch')
239
#_patches+=('0003-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch')
240
241
# http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08799.html [PATCH 5/8] tty: drop alloc_tty_driver
242
# http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08801.html [PATCH 7/8] tty: drop put_tty_driver
243
#_patches+=('0004-kernel-5.15-alloc_tty_driver-put_tty_driver.patch')
244
#_patches+=('0005-kernel-6.0-set_termios-const-ktermios.patch') # https://lore.kernel.org/linux-arm-kernel/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com/T/
245
#_patches+=('0006-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch')
246
#_patches+=('0007-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch')
247
#_patches+=('0008-kernel-6.6-struct-tty_operations-write-size_t.patch')
248
#_patches+=('0009-kernel-6.4-class_create-1arg.patch')
249
_patches+=('0010-kernel-6.12-no_llseek-NULL.patch')
250
251
local _pt _ptf=() _pts=()
252
for _pt in "${_patches[@]}"; do
253
set +u; msg2 "Patch ${_pt}"; set -u
254
if patch -Nup1 --no-backup-if-mismatch -i "${srcdir}/${_pt}"; then
255
_pts+=("${_pt}")
256
else
257
_ptf+=("${_pt}")
258
fi
259
done
260
if [ "${#_ptf[@]}" -gt 0 ]; then
261
if [ "${#_pts[@]}" -gt 0 ]; then
262
printf 'Patch success %s\n' "${_pts[@]}"
263
printf 'Warning: Some old patches may need to be removed even if they are successful\n'
264
fi
265
printf 'Patch failed %s\n' "${_ptf[@]}"
266
set +x
267
false
268
fi
269
#cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
270
#diff -pNaru5 'a' 'b' > "0000-$RANDOM.patch"
271
272
set +u
273
}
274
275
build() {
276
set -u
277
cd "${_srcdir}"
278
make -j1 # too small for parallel make
279
set +u
280
}
281
282
package() {
283
set -u
284
cd "${_srcdir}"
285
if [ "${_opt_DKMS}" -eq 0 ]; then
286
# I don't want Linux version info showing on AUR web. After a few months 'linux<0.0.0' makes it look like an out of date package.
287
local _kernelversionsmall="$(uname -r)"
288
_kernelversionsmall="${_kernelversionsmall%%-*}"
289
_kernelversionsmall="${_kernelversionsmall%\.0}" # trim 4.0.0 -> 4.0, 4.1.0 -> 4.1
290
# prevent the mksrcinfo bash emulator from getting these vars!
291
eval 'conf''licts=("linux>${_kernelversionsmall}" "linux<${_kernelversionsmall}")'
292
eval 'dep''ends+=("linux=${_kernelversionsmall}")'
293
fi
294
295
install -d "${pkgdir}/usr/bin"
296
make -s -j1 DESTDIR="${pkgdir}" install
297
298
# Don't install two copies.
299
rm -r "${pkgdir}/usr/lib/modules"/*/misc
300
301
# The module is in the same folder as DKMS. Compress to a different name to prevent conflict.
302
# When future versions of DKMS compress we'll stop doing this.
303
find "${pkgdir}/usr/lib/modules/" -type 'f' -name '*.ko' -exec 'gzip' '-9' '{}' ';'
304
305
# Desktop file for config tool
306
install -Dm644 <(cat << EOF
307
# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
308
# https://aur.archlinux.org/
309
310
[Desktop Entry]
311
Name=Sunix Configuration Tool
312
GenericName=Serial Port Configuration
313
Comment=Manage Sunix Serial Devices
314
Exec=snxterm
315
Terminal=true
316
Type=Application
317
#Icon=
318
Categories=Application;Utility;
319
MimeType=application/x-executable
320
EOF
321
) "${pkgdir}/usr/share/applications/sunix-snxterm.desktop"
322
323
if [ "${_opt_DKMS}" -ne 0 ]; then
324
rm -r "${pkgdir}/usr/lib/modules/"
325
local _dkms="${pkgdir}/usr/src/${pkgname}-${pkgver}"
326
install -Dm644 <(cat << EOF
327
# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
328
# https://aur.archlinux.org/
329
330
PACKAGE_NAME="${pkgname}"
331
PACKAGE_VERSION="${pkgver}"
332
AUTOINSTALL="yes"
333
334
BUILT_MODULE_NAME[0]="${_modulename}"
335
BUILT_MODULE_LOCATION[0]="driver"
336
# Using all processors doesn't compile this tiny module any faster.
337
MAKE[0]="make -j1 -C 'driver'"
338
CLEAN[0]="make -j1 -C 'driver' clean"
339
# The install version is .ko.gz. The DKMS version is .ko. No conflicts.
340
DEST_MODULE_LOCATION[0]="/kernel/drivers/char"
341
EOF
342
) "${_dkms}/dkms.conf"
343
install -dm755 "${_dkms}/driver/"
344
cp -pr 'driver/' "${_dkms}/"
345
make -s -C "${_dkms}/driver/" clean KERNELRELEASE="$(uname -r)"
346
fi
347
set +u
348
}
349
350
set +u
351
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |