Merge pull request #148045 from arkivm/fix-mxu

mxu11x0: 1.4 -> 4.1
This commit is contained in:
Thiago Kenji Okada 2021-12-03 10:34:40 -03:00 committed by GitHub
commit 22c80fdf53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 7 deletions

View File

@ -1,13 +1,15 @@
{ lib, stdenv, fetchurl, kernel }:
stdenv.mkDerivation {
let
srcs = import (./srcs.nix) { inherit fetchurl; };
in
stdenv.mkDerivation rec {
pname = "mxu11x0";
version = "1.4-${kernel.version}";
src = fetchurl {
url = "https://www.moxa.com/Moxa/media/PDIM/S100000385/moxa-uport-1000-series-linux-3.x-and-4.x-for-uport-11x0-series-driver-v1.4.tgz";
sha256 = "1hz9ygabbp8pv49k1j4qcsr0v3zw9xy0bh1akqgxp5v29gbdgxjl";
};
src = if lib.versionAtLeast kernel.version "5.0" then srcs.mxu11x0_5.src else srcs.mxu11x0_4.src;
mxu_version = if lib.versionAtLeast kernel.version "5.0" then srcs.mxu11x0_5.version else srcs.mxu11x0_4.version;
version = mxu_version + "-${kernel.version}";
preBuild = ''
sed -i -e "s/\$(uname -r).*/${kernel.modDirVersion}/g" driver/mxconf
@ -33,6 +35,8 @@ stdenv.mkDerivation {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ uralbash ];
platforms = platforms.linux;
broken = kernel.kernelAtLeast "5.4";
# broken due to API change in write_room() > v5.14-rc1
# https://github.com/torvalds/linux/commit/94cc7aeaf6c0cff0b8aeb7cb3579cee46b923560
broken = kernel.kernelAtLeast "5.14";
};
}

View File

@ -0,0 +1,18 @@
{ fetchurl }:
{
mxu11x0_4 = {
version = "4.1";
src = fetchurl {
url = "https://www.moxa.com/getmedia/b152d8c2-b9d6-4bc7-b0f4-420633b4bc2d/moxa-uport-1100-series-linux-kernel-4.x-driver-v4.1.tgz";
sha256 = "sha256-sbq5M5FQjrrORtSS07PQHf+MAZArxFcUDN5wszBwbnc=";
};
};
mxu11x0_5 = {
version = "5.1";
src = fetchurl {
url = "https://www.moxa.com/getmedia/57dfa4c1-8a2a-4da6-84c1-a36944ead74d/moxa-uport-1100-series-linux-kernel-5.x-driver-v5.1.tgz";
sha256 = "sha256-pdFIiD5naSDdYwRz8ww8Mg8z1gDOfZ/OeO6Q5n+kjDQ=";
};
};
}