Unverified Commit 845e340e authored by Maximilian Bosch's avatar Maximilian Bosch
Browse files

linux: drop hacky passing around of positions

This is something I introduced in 63185299
to make sure the `version`/`src` attributes point to the files that declare
the version such that we get pinged by ofborg for updates.

This is long obsolete since the versions are maintained in a JSON file
now. Also, the kernel team is listed as owner in the ci/OWNERS file for
the entire subtree, so we definitely get pinged by CI nowadays.

Hence, remove the hackery.
parent 965ea7b1
Loading
Loading
Loading
Loading
+20 −39
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ let
  overridableKernel = lib.makeOverridable (
    # The kernel source tarball.
    {
      pname ? "linux",

      src,

      # The kernel version.
@@ -96,25 +98,6 @@ let
    # files.

    let
      # Dirty hack to make sure that `version` & `src` have
      # `<nixpkgs/pkgs/os-specific/linux/kernel/linux-x.y.nix>` as position
      # when using `builtins.unsafeGetAttrPos`.
      #
      # This is to make sure that ofborg actually detects changes in the kernel derivation
      # and pings all maintainers.
      #
      # For further context, see https://github.com/NixOS/nixpkgs/pull/143113#issuecomment-953319957
      basicArgs = removeAttrs args (
        lib.filter (
          x:
          !(builtins.elem x [
            "version"
            "pname"
            "src"
          ])
        ) (lib.attrNames args)
      );

      # Combine the `features' attribute sets of all the kernel patches.
      kernelFeatures = lib.foldr (x: y: (x.features or { }) // y) (
        {
@@ -298,10 +281,11 @@ let
        };
      }; # end of configfile derivation

      kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) (
        basicArgs
        // {
      kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) {
        inherit
          pname
          version
          src
          kernelPatches
          randstructSeed
          extraMakeFlags
@@ -309,15 +293,13 @@ let
          configfile
          modDirVersion
          ;
          pos = builtins.unsafeGetAttrPos "version" args;

        config = {
          CONFIG_MODULES = "y";
          CONFIG_FW_LOADER = "y";
          CONFIG_RUST = if withRust then "y" else "n";
        };
        }
      );
      };

    in
    kernel.overrideAttrs (
@@ -326,7 +308,6 @@ let
        passthru =
          previousAttrs.passthru or { }
          // extraPassthru
          // basicArgs
          // {
            features = kernelFeatures;
            inherit
+0 −4
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@ lib.makeOverridable (
    version,
    # The kernel pname (should be set for variants)
    pname ? "linux",
    # Position of the Linux build expression
    pos ? null,
    # Additional kernel make flags
    extraMakeFlags ? [ ],
    # The name of the kernel module directory
@@ -551,8 +549,6 @@ lib.makeOverridable (

    karch = stdenv.hostPlatform.linuxArch;

    pos = lib.optionalDrvAttr (pos != null) pos;

    meta = {
      # https://github.com/NixOS/nixpkgs/pull/345534#issuecomment-2391238381
      broken = withRust && lib.versionOlder version "6.12";