Skip to content

Commit

Permalink
Merge pull request #148045 from arkivm/fix-mxu
Browse files Browse the repository at this point in the history
mxu11x0: 1.4 -> 4.1
  • Loading branch information
thiagokokada authored Dec 3, 2021
2 parents c71f061 + 154c9d5 commit 22c80fd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pkgs/os-specific/linux/mxu11x0/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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";
};
}
18 changes: 18 additions & 0 deletions pkgs/os-specific/linux/mxu11x0/srcs.nix
Original file line number Diff line number Diff line change
@@ -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=";
};
};
}

0 comments on commit 22c80fd

Please sign in to comment.