diff options
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | PKGBUILD | 42 | ||||
-rw-r--r-- | dkms.conf | 8 | ||||
-rw-r--r-- | mxu11x0.c.patch | 104 |
5 files changed, 186 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..df565829a187 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = mxu11x0-dkms + pkgdesc = Kernel module for Moxa UPort 11x0 serial to USB converters + pkgver = 5.14.6 + pkgrel = 1 + url = http://www.moxa.com + arch = i686 + arch = x86_64 + license = GPL + makedepends = unzip + makedepends = tar + depends = glibc + depends = dkms + optdepends = linux-headers: build module against the Arch kernel + optdepends = linux-lts-headers: build module against the LTS kernel + optdepends = linux-zen-headers: build module against the ZEN kernel + optdepends = linux-hardened-headers: build module against the HARDENED kernel + conflicts = mxu11x0 + source = https://www.moxa.com/getmedia/502ff380-9944-4af7-8ed2-20883d2ae702/moxa-uport-1100-series-linux-kernel-5.x-driver-v5.0.zip + source = dkms.conf + source = mxu11x0.c.patch + sha512sums = 019de09b4aee3d0c5ed5a0393e42e52768780fc1611bce4c21c3496584e294be303dbf896456cbcdf6c4be8ad94e6b44d8f4537b546fa6c356f0cd8b7835f9a1 + sha512sums = d321cb599264f3efb2a6f5bb50048aa95cd823f18e65bf5b709db06313f59266a44ccb9bc460a502457de418b8cbacef6b96c23c144f7695785ebe74b5e13a4c + sha512sums = 63c6340ca06a2e2a0a2522e9ba36860670fdb9366ede1d908d4f9a95850165cb53015ccf08c0ef291a2c26b372fa81f1338650b65195307b6c204a4e0c0c2ddf + +pkgname = mxu11x0-dkms diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..dad81a57a84c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +pkg/ +src/ +*.pkg.tar.xz +*.tar.bz2 +*.tar.gz +*.tar.zst +moxa-uport-1100-series-linux-kernel-5.x-driver-v5.0.zip diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fc267d4d627b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +_pkgbase=mxu11x0 +pkgname=${_pkgbase}-dkms +pkgver=5.14.6 +pkgrel=1 +pkgdesc="Kernel module for Moxa UPort 11x0 serial to USB converters" +url="http://www.moxa.com" +license=("GPL") +arch=('i686' 'x86_64') +depends=('glibc' 'dkms') +makedepends=('unzip' 'tar') +conflicts=("${_pkgbase}") +optdepends=('linux-headers: build module against the Arch kernel' + 'linux-lts-headers: build module against the LTS kernel' + 'linux-zen-headers: build module against the ZEN kernel' + 'linux-hardened-headers: build module against the HARDENED kernel') +source=( + "https://www.moxa.com/getmedia/502ff380-9944-4af7-8ed2-20883d2ae702/moxa-uport-1100-series-linux-kernel-5.x-driver-v5.0.zip" + 'dkms.conf' + 'mxu11x0.c.patch') +sha512sums=('019de09b4aee3d0c5ed5a0393e42e52768780fc1611bce4c21c3496584e294be303dbf896456cbcdf6c4be8ad94e6b44d8f4537b546fa6c356f0cd8b7835f9a1' + 'd321cb599264f3efb2a6f5bb50048aa95cd823f18e65bf5b709db06313f59266a44ccb9bc460a502457de418b8cbacef6b96c23c144f7695785ebe74b5e13a4c' + '63c6340ca06a2e2a0a2522e9ba36860670fdb9366ede1d908d4f9a95850165cb53015ccf08c0ef291a2c26b372fa81f1338650b65195307b6c204a4e0c0c2ddf' +) + +prepare() { + tar -xzf driv_linux_uport_v5.0_build_19110614.tgz + [[ -d ${_pkgbase}-${pkgver} ]] || mkdir ${_pkgbase}-${pkgver} + mv mxu11x0/driver/Makefile mxu11x0/driver/*.[hc] ${_pkgbase}-${pkgver} + patch ${_pkgbase}-${pkgver}/mxu11x0.c mxu11x0.c.patch +} + +package() { + install -Dm644 dkms.conf "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf" + mkdir -p "${pkgdir}/etc/modules-load.d/" + echo "${_pkgname}" > "${pkgdir}/etc/modules-load.d/${_pkgbase}.conf" + + sed -e "s/@PKGNAME@/${_pkgbase}/g" \ + -e "s/@PKGVER@/${_pkgbase}/g" \ + -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf" + + cp -dr "${_pkgbase}-${pkgver}" "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/src" +} diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..b3471e3efec9 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,8 @@ +PACKAGE_NAME="@PKGNAME@" +PACKAGE_VERSION="@PKGVER@" +MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build/src modules" +CLEAN="rm src/@PKGNAME@.ko src/*.o || true" +BUILT_MODULE_NAME[0]="@PKGNAME@" +BUILT_MODULE_LOCATION[0]="src/" +DEST_MODULE_LOCATION[0]="/kernel/drivers/usb/serial" +AUTOINSTALL="yes" diff --git a/mxu11x0.c.patch b/mxu11x0.c.patch new file mode 100644 index 000000000000..8888bee7658b --- /dev/null +++ b/mxu11x0.c.patch @@ -0,0 +1,104 @@ +85a86,90 +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,12,6)) +> #define ASYNCB_FIRST_KERNEL 0 +> #else +> #define ASYNCB_FIRST_KERNEL 1 +> #endif +166,167c171,184 +< static int mxu1_write_room(struct tty_struct *tty); +< static int mxu1_chars_in_buffer(struct tty_struct *tty); +--- +> static +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +> int +> #else +> unsigned int +> #endif +> mxu1_write_room(struct tty_struct *tty); +> static +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +> int +> #else +> unsigned int +> #endif +> mxu1_chars_in_buffer(struct tty_struct *tty); +225a243,246 +> #if (LINUX_VERSION_CODE > KERNEL_VERSION(5,13,0)) +> static void mxu1_get_serial_info2(struct tty_struct *tty, +> struct serial_struct __user *ret_arg); +> #else +227a249 +> #endif +526c548 +< .chars_in_buffer = mxu1_chars_in_buffer, +--- +> .chars_in_buffer= mxu1_chars_in_buffer, +1185c1207,1213 +< static int mxu1_write_room(struct tty_struct *tty) +--- +> static +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +> int +> #else +> unsigned int +> #endif +> mxu1_write_room(struct tty_struct *tty) +1197a1226,1227 +> +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +1198a1229,1231 +> #else +> return 0; +> #endif +1213c1246,1252 +< static int mxu1_chars_in_buffer(struct tty_struct *tty) +--- +> static +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +> int +> #else +> unsigned int +> #endif +> mxu1_chars_in_buffer(struct tty_struct *tty) +1215c1254 +< struct usb_serial_port *port = tty->driver_data; +--- +> struct usb_serial_port *port = tty->driver_data; +1224a1264 +> #if(LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) +1225a1266,1268 +> #else +> return 0; +> #endif +2269c2312,2318 +< static int mxu1_get_serial_info2(struct tty_struct *tty, +--- +> static +> #if (LINUX_VERSION_CODE > KERNEL_VERSION(5,13,0)) +> void +> #else +> int +> #endif +> mxu1_get_serial_info2(struct tty_struct *tty, +2275,2277c2324,2332 +< if (!ret_arg) +< return -EFAULT; +< +--- +> if (!ret_arg) { +> +> #if (LINUX_VERSION_CODE > KERNEL_VERSION(5,13,0)) +> return; +> #else +> return -EFAULT; +> #endif +> } +> +2287,2288c2342,2345 +< +< return 0; +--- +> +> #if (LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)) +> return 0; +> #endif |