Unverified Commit a3854adc authored by dotlambda's avatar dotlambda Committed by GitHub
Browse files

zfs: simplify kernelIsCompatible function (#510656)

parents fc48c98e 9d66a1bc
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -76,20 +76,8 @@ let
      ];
      kernelIsCompatible =
        kernel:
        let
          nextMajorMinor =
            ver:
            "${lib.versions.major ver}.${
              lib.pipe ver [
                lib.versions.minor
                lib.toInt
                (x: x + 1)
                toString
              ]
            }";
        in
        (lib.versionAtLeast kernel.version kernelMinSupportedMajorMinor)
        && (lib.versionOlder kernel.version (nextMajorMinor kernelMaxSupportedMajorMinor));
        && (lib.versionAtLeast kernelMaxSupportedMajorMinor (lib.versions.majorMinor kernel.version));

      # XXX: You always want to build kernel modules with the same stdenv as the
      # kernel was built with. However, since zfs can also be built for userspace we