Commit Graph

35 Commits

Author SHA1 Message Date
Maximilian Bosch
5645cd22d4
linux: expose make flags for modules in linuxKernel.packages.linux_X_Y
Closes #376820

The issue with providing `moduleMakeFlags` via `passthru` of the kernel
package is that when this package gets overriden[1], the `moduleMakeFlags`
list still references the kernel without the overrides.

This broke e.g. kernel modules of linux-rpi4 which can be reproduced
with

    nix-build --argstr system aarch64-linux -A linuxKernel.packages.linux_rpi4.zfs_2_3

This used to break with

    Error: modDirVersion 6.6.51 specified in the Nix expression is wrong, it should be: 6.6.51-v8

since KBUILD_OUTPUT referenced the kernel without the changes from
`overrideDerivation` that also changes the `modDirVersion`.

The new approach is to add the build flags right into
`linuxKernel.packages.linux_X_Y`: that way we don't need any hacks to
update `moduleMakeFlags` when the derivation with the passthru gets
overridden.

By using the fixpoint of the package-set, the `kernelModuleMakeFlags`
list is correctly updated. E.g. given

    with import ./. {};

    linuxKernel.packages.linux_6_6.extend (self: super: {
      kernel = super.kernel.overrideAttrs (_: {
        name = "linux-snens";
      });
    })

the `makeFlags` is correctly updated:

    $ nix-instantiate snenskek.nix -A zfs_2_3.makeFlags --eval --strict
    [ "ARCH=x86_64" "CROSS_COMPILE=" "KBUILD_OUTPUT=/nix/store/gsp68549k1aqbwxwczpgw67w5jjn4shw-linux-snens-dev/lib/modules/6.6.74/build" ]

[1] E.g. `linux-rpi4`.
2025-01-27 16:09:50 +01:00
K900
aa3e94fe7c treewide: kernel.makeFlags -> kernel.moduleMakeFlags 2025-01-23 14:00:43 +03:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
Artturin
6e3bff617f treewide: remove replacements of '$(shell uname -r)' with '${kernel.modDirVersion}'
after adding deterministic-uname to kernel.moduleBuildDependencies this
is unnecessary
2023-01-22 13:46:12 +02:00
Zane van Iperen
4ee298daf7
linuxPackages.bbswitch: 0.8 -> unstable-2021-11-29 (#179644)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-08-05 15:24:37 +02:00
Alyssa Ross
fe564f56b4 linuxPackages.bbswitch: mark broken on Linux 5.18 2022-05-25 12:29:13 +00:00
Felix Buehler
2653630f27 bbswitch: switch to fetchFromGitHub 2021-09-19 17:13:17 +02:00
Bernardo Meurer
98018cce2c
linuxPackages.bbswitch: use kernel's make flags
We should be using whatever makeflags were used to build the kernel
itself, otherwise clang-built kernels cannot use the module.
2021-09-10 14:42:17 -07:00
Alyssa Ross
5c14c688d2 linuxPackages.bbswitch: add license 2021-09-08 17:17:27 +00:00
Profpatsch
4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00
Peter Simons
00222dbb0e bbswitch: fix build with Linux kernel version >= 5.6.0
Fixes https://github.com/NixOS/nixpkgs/issues/85564.
2020-04-19 16:25:48 +02:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Jörg Thalheim
dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00
rnhmjoj
bcf54ce5bb
treewide: use ${stdenv.shell} instead of /bin/sh where possible 2019-01-16 20:37:15 +01:00
Nikolay Amiantov
1890fe359a linuxPackages.bbswitch: disable on AArch64
It makes no sense on non-x86 platforms.
2018-03-09 16:35:10 +03:00
Franz Pletz
1fb0d3d158
Fix some instances of #33166 correctly 2017-12-29 22:35:32 +01:00
Christoph Hrdinka
a3c45b383d
bbswitch: add libelf to buildInputs
Signed-off-by: Christoph Hrdinka <c.github@hrdinka.at>
2017-12-28 13:28:39 +01:00
Franz Pletz
aff1f4ab94 Use general hardening flag toggle lists
The following parameters are now available:

  * hardeningDisable
    To disable specific hardening flags
  * hardeningEnable
    To enable specific hardening flags

Only the cc-wrapper supports this right now, but these may be reused by
other wrappers, builders or setup hooks.

cc-wrapper supports the following flags:

  * fortify
  * stackprotector
  * pie (disabled by default)
  * pic
  * strictoverflow
  * format
  * relro
  * bindnow
2016-03-05 18:55:26 +01:00
Robin Gloster
c3a98e7521 linuxPackages.bbswitch: turn off pic hardening 2016-02-12 02:14:52 +00:00
Nikolay Amiantov
7626674ae0 bbswitch: maintain, fix (transient?) hash failure 2015-04-06 02:58:30 +03:00
Nikolay Amiantov
8220246beb bbswitch: add patch to fix Lenovo t440p 2015-04-05 16:12:34 +03:00
Eelco Dolstra
40f7b0f9df Another attempt to eradicate ensureDir
See c556a6ea46.
2014-06-30 14:56:10 +02:00
Corey O'Connor
19c59ab984 upgrade bbswitch to 0.8 2014-03-04 01:05:12 +01:00
Shea Levy
a589bfae17 Update and fix kernel packages to new kernel build
In most cases, this just meant changing kernelDev (now removed from
linuxPackagesFor) to kernel.dev. Some packages needed more work (though
whether that was because of my changes or because they were already
broken, I'm not sure). Specifics:

* psmouse-alps builds on 3.4 but not 3.10, as noted in the comments that
  were already there
* blcr builds on 3.4 but not 3.10, as noted in comments that were
  already there
* open-iscsi, ati-drivers, wis-go7007, and openafsClient don't build on
  3.4 or 3.10 on this branch or on master, so they're marked broken
* A version-specific kernelHeaders package was added

The following packages were removed:

* atheros/madwifi is superceded by official ath*k modules
* aufs is no longer used by any of our kernels
* broadcom-sta v6 (which was already packaged) replaces broadcom-sta
* exmap has not been updated since 2011 and doesn't build
* iscis-target has not been updated since 2010 and doesn't build
* iwlwifi is part of mainline now and doesn't build
* nivida-x11-legacy-96 hasn't been updated since 2008 and doesn't build

Everything not specifically mentioned above builds successfully on 3.10.
I haven't yet tested on 3.4, but will before opening a pull request.

Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-04 21:17:04 -05:00
Mathijs Kwik
61021c5739 bbswitch: upgrade to 0.7 2013-08-25 14:31:05 +02:00
Shea Levy
4fa4ab3a6e Partially revert my recent kernelPackages changes
First, pass in `self' again so that overriding works properly (thanks
for pointing that out, @edolstra)

Second, instead of having linuxPackages*.kernel mean something different
inside the set and out, add a new attribute linuxPackages*.kernelDev,
which for the generic kernel is simply linuxPackages*.kernel but for the
manual-config kernel is the `dev' output (which has the build tree,
source tree, etc.)

The second change required trivial modifications in a bunch of
expressions, I verified that all of the linuxPackages* sets defined in
all-packages.nix have the same drv paths before and after the change.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-03-24 07:45:00 -04:00
Mathijs Kwik
011fc66a7c bbswitch: upgrade to 0.6 2013-03-22 00:00:05 +01:00
Mathijs Kwik
6338743942 bbswitch: upgrade to 0.5 - add linux 3.8 compatibility patch 2013-03-04 22:40:33 +01:00
Mathijs Kwik
5ff5c38cb6 bbswitch: upgraded to 0.4.2
svn path=/nixpkgs/trunk/; revision=34025
2012-05-09 10:01:38 +00:00
Mathijs Kwik
d329b66b73 bbswitch: use the modDirVersion instead of version
svn path=/nixpkgs/trunk/; revision=33244
2012-03-18 23:13:41 +00:00
Arie Middelkoop
ed813f3955 Let 'bbswitch' and 'acpi-call' use the attribute kernel.version instead of a nasty 'ls' to determine the kernel version.
svn path=/nixpkgs/trunk/; revision=32531
2012-02-24 00:17:09 +00:00
Peter Simons
846a12f954 fixed download urls after kernel-depending packages had their names changed
svn path=/nixpkgs/trunk/; revision=32484
2012-02-22 20:29:22 +00:00
Eelco Dolstra
b23126fcc3 * Include the kernel version in kernel-specific packages so that they
can be distinguished in nix-env -qa output.

svn path=/nixpkgs/trunk/; revision=32352
2012-02-17 14:32:28 +00:00
Arie Middelkoop
62e9429908 Added the 'bbswitch' module, which is a more conventient module for powering off/on nvidia graphics cards than possible via the acpi_call module.
svn path=/nixpkgs/trunk/; revision=31840
2012-01-26 01:02:22 +00:00