moxa-mxser-mxupcie

maintainer severach · 0 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The package downloads a source tarball from Moxa's official domain (moxa.com), which is the legitimate vendor; despite the static analyzer flag for a non-standard host, this is a normal and expected source for the driver, and the checksum is verified.

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 package downloads a source tarball from Moxa's official domain (moxa.com), which is the legitimate vendor; despite the static analyzer flag for a non-standard host, this is a normal and expected source for the driver, and the checksum is verified.

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:57 "https://www.moxa.com/drivers/MSB/SmartioIndustio/driv_linux_smart_v${pkgver}_build_${_build}.tgz"

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
2
3# TODO: Test msdiag for Smartio/Industio card. Can't test until mxser works.
4# TODO: Test mxser with supported PCI card
5# TODO: Get remaining tools mon and term that use mxlib.a and wlib.a to compile. Nothing in the headers look secret so Moxa should release the source code.
6# TODO: mxupcie does not report itself for lspci -k Kernel driver in use:
7
8# TODO: Test CP-114EL on Syba cable
9
10_opt_DKMS=1 # This can be toggled between installs
11_opt_MXSER=0 # Old PCI and ISA cards, with C168H IRQ error then crashed on unload
12
13# mxser
14# C104 C168
15# CB108 CB114 CB134I
16# CP102 CP102U CP102UF CP102UL CP104EL CP104JU CP104U CP112UL CP114 CP114UL CP118EL CP118U CP132 CP132U CP134U CP138U CP168EL CP168U
17# CT114
18# POS104UL
19# RC7000
20
21# mxupcie
22# CP-102E
23# CP-102EL
24# CP-104EL
25# CP-114EL
26# CP-116EA (A)
27# CP-116EA (B)
28# CP-118E-A-I
29# CP-118EL
30# CP-132EL
31# CP-134EL-A
32# CP-138E-A
33# CP-168EL
34
35set -u
36
37_modulenames=('mxupcie')
38if [ "${_opt_MXSER}" -ne 0 ]; then
39 _modulenames+=('mxser')
40fi
41_origmodname='8250_moxa'
42
43pkgname='moxa-mxser-mxupcie'
44pkgver='1.16'; _build='14030317'
45pkgrel='3'
46pkgdesc='kernel module driver for Moxa Smartio Industio MUE ISA PCIe UPCI PCI Express CP multi port serial RS-232 422 485'
47arch=('i686' 'x86_64')
48url='https://www.moxa.com/product/PCIe_UPCI_PCI.htm'
49#url='https://github.com/uecasm/mxser'
50license=('GPL')
51makedepends=('findutils' 'sed' 'diffutils' 'patch')
52backup=("etc/modprobe.d/${_modulenames[0]}.conf" 'etc/moxa-mxser-settings.sh')
53options=('!strip')
54install="${pkgname}-install.sh"
55_srcdir='mxser'
56source=(
57 "https://www.moxa.com/drivers/MSB/SmartioIndustio/driv_linux_smart_v${pkgver}_build_${_build}.tgz"
58 '0000-mxser-utilities-warnings.patch'
59 '0001-mxser-kernel-4.12-IRQF_DISABLED.patch'
60 '0003-kernel-5.0.0-access_ok.patch'
61)
62sha256sums=('445f452eb7f56b70ef1b9795421556fb28284a90cde8746e5895316d5c67899f'
63 '4988d6cc1c779c1e30f659896e9e25beaedb4a473d4f2f09a81bbef5d2ccb276'
64 '7357da2ada66681705b2c6806fa3fe910ddd198e531d851bd0a97b548de4bbb3'
65 'ba1a55fa48f93f3a309bec5783d7deb5f728798ae39f28301d19384b5444113e')
66
67# Moxa https doesn't work with curl
68for _dlagentk in "${!DLAGENTS[@]}"; do
69 case "${DLAGENTS[${_dlagentk}]}" in
70 'https::/'*) DLAGENTS[${_dlagentk}]="${DLAGENTS[${_dlagentk}]//\/curl -/\/curl -k}";;
71 esac
72done
73
74# We can't modify .install but we can stop and force the user to fix it.
75_install_check() {
76 local _ckvar
77 local _ckline
78 local _pkgname="${pkgname}"
79 for _ckvar in _pkgname _modulenames; do
80 _ckline="$(declare -p ${_ckvar} 2>/dev/null)"
81 _ckline="${_ckline#* }"
82 _ckline="${_ckline#* }"
83 _ckline="${_ckline//\[[0-9]\]=/}" # unenumerate arrays
84 _ckline="${_ckline//\"/\'}"
85 if ! grep -q "^${_ckline}"'$' "${startdir}/${install}"; then
86 set +u
87 msg "${install} must be fixed"
88 echo "${_ckline}"
89 false
90 fi
91 done
92}
93
94prepare() {
95 set -u
96 _install_check
97 cd "${_srcdir}"
98 # diff -pNaru5 src{.old,} > '0001-mxser-kernel-4.12-IRQF_DISABLED.patch'
99 patch -Nup2 -i '../0001-mxser-kernel-4.12-IRQF_DISABLED.patch'
100
101 # diff -pNaru5 'src.old/mxser' 'src/mxser' > '0000-mxser-utilities-warnings.patch'
102 patch -Nup2 -i '../0000-mxser-utilities-warnings.patch'
103
104 #cp -pr driver{,.orig}; false
105 #diff -pNaru5 driver{.orig,} > '0003-kernel-5.0.0-access_ok.patch'
106 patch -Nbup0 -i "${srcdir}/0003-kernel-5.0.0-access_ok.patch"
107
108 # Make package compatible
109 # cp -p driver/Makefile{,.Arch}
110 sed -e '# Fix path' \
111 -e 's:/lib/:/usr/lib/:g' \
112 -e '# Remove leading @ to prevent silent execution' \
113 -e 's:^\t@:\t:g' \
114 -e '# Disable envchk' \
115 -e '/^module/ s:envchk::g' \
116 -e '# Remove build log helper that hides output' \
117 -e '/^\t\$(MAKE)/ s:\s\+2>>.\+$::g' \
118 -e '# Disable all make lines' \
119 -e '/^module2*:/,/^$/ s:^\t:#\t:g' \
120 -e '# Reenable module targets' \
121 -e '/^#module2*:/ s:^#::g' \
122 -e '# Reenable make line' \
123 -e '/^#\t\$(MAKE/ s:^#\t:\t:g' \
124 -e '# Fix install lines' \
125 -e '# Dont remake modules on install' \
126 -e '/^install/ s:module2*::g' \
127 -e '# Make package compatible' \
128 -e '/^install/,/^$/ s:/usr/:"$(DESTDIR)"&:g' \
129 -e '# Disable depmod' \
130 -e 's:^\tdepmod:\ttrue depmod:g' \
131 -e '# Kernel 5.4 compatible' \
132 -e 's: SUBDIRS=\([^ ]\+\) : M=\1&:g ' \
133 -i 'driver/Makefile'
134 test ! -s driver/Makefile.Arch
135 set +u
136}
137
138build() {
139 set -u
140 cd "${_srcdir}"
141 make -C 'utility/conf' -s -j1 # too small for parallel make
142 if [ "${_opt_MXSER}" -ne 0 ]; then
143 make -C 'utility/diag' -s -j1 # too small for parallel make
144 fi
145 make -C 'driver' -s -j1 module # too small for parallel make
146 set +u
147}
148
149package() {
150 set -u
151 cd "${_srcdir}"
152
153 install -Dpm755 'utility/conf/muestty' "${pkgdir}/usr/bin/moxa-muestty"
154 if [ "${_opt_MXSER}" -ne 0 ]; then
155 install -Dpm755 'utility/diag/msdiag' "${pkgdir}/usr/bin/moxa-msdiag"
156 fi
157 make -C 'driver' -s -j1 install DESTDIR="${pkgdir}"
158
159 # Don't install twice
160 rm -r "${pkgdir}/usr/lib/modules/$(uname -r)/misc"
161
162 # Install persistent settings service
163 install -Dm644 <(cat << EOF
164# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
165# https://aur.archlinux.org/
166
167[Unit]
168Description=Moxa mxser serial port persistent settings
169After=network.target
170
171[Service]
172Type=notify
173ExecStart=/usr/bin/bash -c 'source /etc/${pkgname}.sh; systemd-notify --ready'
174RemainAfterExit=yes
175
176[Install]
177WantedBy=multi-user.target
178EOF
179 ) "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
180
181 install -Dm644 <(cat << EOF
182# From driver/rx.mxser
183
184# Use moxa-muestty to set RS-422 and RS-485 settings per port at every boot.
185# Some settings can be set for all ports in /etc/modprobe.d/${pkgname}.conf
186#
187# moxa-muestty -t xxx /dev/ttyMUE0
188# moxa-muestty -p xxx /dev/ttyMUE0
189EOF
190 ) "${pkgdir}/etc/${pkgname}.sh"
191
192 # Blacklist exiting incomplete built in module
193 install -Dm644 <(cat << EOF
194# From driver/rx.mxser
195
196# When using ISA board, please add parameter to options
197# options mxser ioaddr=x,x,x,x
198#
199# ex : I/O address=0x180 & 0x280
200# options mxser ioaddr=0x180,0x280
201#
202# You can add other parameters as well
203#
204# ex : interface=0x01
205# options mxupcie interface=0x01
206
207# From readme.txt
208# The MUE series multiport board provides two options to set
209# the interface and terminator resistor while loading the driver.
210# The two options are available while working in RS-422 and
211# RS-485 mode. Option's value is applied to all ports on the
212# devices.
213
214# options mxupcie interface=2 terminator=1
215# | |
216# | +- 120 ohm
217# +-------------- RS-422
218
219# The interface and terminator have values to set as follows.
220
221# Option Value Comment
222
223# interface 1 RS-232
224# 2 RS-422
225# 4 RS-485 2 wire
226# 8 RS-485 4 wire
227
228# terminator 0 0 ohm
229# 1 120 ohm
230
231# Do not load built in module with only barebones support
232blacklist ${_origmodname}
233EOF
234 ) "${pkgdir}/etc/modprobe.d/${pkgname}.conf"
235
236 # The module is in the same folder as DKMS. Compress to a different name to prevent conflict.
237 # When future versions of DKMS compress we'll stop doing this.
238 find "${pkgdir}/usr/lib/modules/" -type 'f' -name '*.ko' -exec 'gzip' '-9' '{}' ';'
239
240 if [ "${_opt_DKMS}" -ne 0 ]; then
241 rm -rf "${pkgdir}/usr/lib/modules/"
242 local _dkms="${pkgdir}/usr/src/${pkgname}-${pkgver}"
243 install -Dm644 <(cat << EOF
244# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
245# https://aur.archlinux.org/
246
247PACKAGE_NAME="${pkgname}"
248PACKAGE_VERSION="${pkgver}"
249AUTOINSTALL="yes"
250# MAKE[0] is expected to make all modules with an umbrella makefile
251MAKE[0]="make -C driver -j1"
252
253BUILT_MODULE_NAME[0]="${_modulenames[0]}"
254BUILT_MODULE_LOCATION[0]="driver"
255# The install version is .ko.gz. The DKMS version is .ko. No conflicts.
256DEST_MODULE_LOCATION[0]="/kernel/drivers/char"
257EOF
258 ) "${_dkms}/dkms.conf"
259 if [ "${_opt_MXSER}" -ne 0 ]; then
260 cat >> "${_dkms}/dkms.conf" << EOF
261
262BUILT_MODULE_NAME[1]="${_modulenames[1]}"
263BUILT_MODULE_LOCATION[1]="driver"
264# The install version is .ko.gz. The DKMS version is .ko. No conflicts.
265DEST_MODULE_LOCATION[1]="/kernel/drivers/char"
266EOF
267 fi
268 cp -pr 'driver/' "${_dkms}/"
269 rm "${_dkms}/driver"/{msmknod,mxconf,rc.mxser}
270 sed -e '/^KERNEL_/ s:shell uname -r:shell echo "$(KERNELRELEASE)":g' \
271 -e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
272 -e 's:shell uname -r:KERNELRELEASE:g' \
273 -e '# DKMS sets KERNELRELEASE which accidentally launches phase 2 of this Makefile' \
274 -e '# Fix by changing the detection var.' \
275 -e '# SUBDIRS makes more sense to me because I can see it in the Makefile!' \
276 -e 's:^ifneq (\$(KERNELRELEASE),):ifneq (\$(SUBDIRS),):g' \
277 -e '# Disable stuff only used for make install' \
278 -e '/^base =/,/^$/ d' \
279 -e '# Disable non kernel utilities' \
280 -e 's:^UTILS:# &:g' \
281 -i "${_dkms}/driver/Makefile"
282 if [ "${_opt_MXSER}" -eq 0 ]; then
283 sed -e '/obj/ s:$(TARGET_DRIVER1).o::g' -i "${_dkms}/driver/Makefile"
284 rm "${_dkms}/driver"/mxser.*
285 fi
286 make -s -C "${_dkms}/driver/" clean KERNELRELEASE="$(uname -r)"
287 fi
288 set +u
289}
290
291set +u
292

Scan history

Scanned at (UTC)SeverityRules
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

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion