Commit Graph

194 Commits

Author SHA1 Message Date
Sandro Jäckel
000e115d02 kernel: move prePatch to postPatch to not mess with patches 2022-10-14 23:56:28 +02:00
Maximilian Bosch
dd6727e7b8
linux/hardened/5.19: fix build
The options GCC_PLUGIN_RANDSTRUCT{,_PERFORMANCE} have been renamed to
`RANDSTRUCT_*` in 595b893e2087de306d0781795fb8ec47873596a6 since CLang
is about to support this as well and thus the options had to be
generalized.

Also, the file that is used to generate the seed has changed, only the
reference to the file in the patch was changed on adding Linux 5.19[1]

[1] b4d0cb4497
2022-09-18 12:14:00 +02:00
K900
fd53244bec linux: fix builds for old LTS kernels 2022-08-21 11:07:58 +03:00
K900
5f45f2506d linux: better note 2022-08-20 00:06:13 +03:00
K900
907b497d7e nixos/hardware/device-tree: use symbols from the exact kernel package 2022-08-19 20:17:28 +03:00
K900
846d001fb8 linux: don't try to mass clean paths
This whole thing is utterly broken, but let's start here.
Should fix intermittent build failures with patchShebangs.
2022-08-19 20:17:18 +03:00
Sergei Trofimovich
8ab16e40be pkgsCross.ppc64.linux: flatten makeFlags
Before the cgange:

    nix-repl> pkgsCross.ppc64.linux.makeFlags
    [ "O=$(buildRoot)"
      "CC=/06pbgv2957wl3wcpd2gljml719lw123njq9dhj7h6n2pv4nwgwhl/bin/powerpc64-unknown-linux-gnu-cc"
      "HOSTCC=/0calwri0wxl5mbjl5q80r1hm9hchyk8a7hhayk6cdfrxgbfbia3n/bin/cc"
      "ARCH=powerpc"
      [ ... ] ]

After the change:

    nix-repl> pkgsCross.ppc64.linux.makeFlags
    [ "O=$(buildRoot)"
      "CC=/06pbgv2957wl3wcpd2gljml719lw123njq9dhj7h6n2pv4nwgwhl/bin/powerpc64-unknown-linux-gnu-cc"
      "HOSTCC=/0calwri0wxl5mbjl5q80r1hm9hchyk8a7hhayk6cdfrxgbfbia3n/bin/cc"
      "ARCH=powerpc"
      "CROSS_COMPILE=powerpc64-unknown-linux-gnu-" ]
2022-08-16 17:34:46 +01:00
Alyssa Ross
ea29d1b601
linux: use writeShellScript 2022-07-29 09:28:57 +00:00
Alyssa Ross
c48f9c6218
linux: inline "commonMakeFlags"
Since 7a9b6ac39a ("kernel: Enable cross compiling"), commonMakeFlags
has only been used once.  Since these flags aren't "common" between
anything any more, they should just be inlined to make the expression
easier to read.
2022-07-29 09:28:39 +00:00
Roman Volosatovs
b4d0cb4497 kernel: port randstruct patch to 5.19
Signed-off-by: Roman Volosatovs <roman@profian.com>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-07-22 15:04:50 +00:00
Edmund Wu
71c1d90be4
linux: include zstd in module dependencies 2022-07-08 01:22:51 -04:00
Ben Siraphob
259fa13d53 treewide: remove nativeBuildInputs that are in stdenv 2022-04-16 21:46:46 +03:00
Artturin
33cce15e42 treewide: remove meta.repositories
there's no documentation for meta.repositories and its not widely used
2022-03-24 23:56:14 +02:00
Nick Cao
72db02ec9e
kernel: add perl to moduleBuildDependencies 2022-03-07 12:23:43 +08:00
Atemu
8d0f1c1725 kernel: compare version against the base version
This makes it so that 5.10.1 > 5.10-rc5
2021-11-22 02:11:16 +00:00
github-actions[bot]
83d6b7a7e0
Merge staging-next into staging 2021-11-01 18:01:40 +00:00
Maximilian Bosch
63185299f4
linux: make sure that src/version actually refer to the declaring file
With this change it's ensured that `builtins.unsafeGetAttrPos` actually
points to `<nixpkgs/pkgs/os-specific/linux/kernel/linux-x.y.nix>` when
retrieving the position of `src` or `version` of
`linuxPackages.kernel`.

This is relevant to make sure that ofborg pinging maintainers on kernel updates
actually works[1]. While the underlying issue should be fixed in ofborg
or Nix itself, this is IMHO a pragmatic change to ensure that all kernel
maintainers are automatically notified on updates.

[1] https://github.com/NixOS/nixpkgs/pull/143113#issuecomment-953319957
2021-11-01 10:06:00 +01:00
Jonathan Ringer
e9a1ba099f linuxPackages_5_10_hardened: fix patching conflict with patchShebang 2021-10-29 13:23:10 -07:00
Maximilian Bosch
65930caffe
linux: create maintainer team
Now there are a few more folks who should get pinged on kernel changes:

    $ nix-instantiate -E 'with import ./. {}; (map (x: x.github) linux.meta.maintainers)' --eval  --strict
    [ "TredwellGit" "mweinelt" "ma27" "nequissimus" "alyssais" "thoughtpolice" ]

Refs #140281
2021-10-20 23:49:33 +02:00
Linus Heckemann
dd5f07afca
linux: build dtbs in parallel (#106846)
linux: build DTBs in buildPhase, install with everything else

This improves build speed, especially on machines with lots of cores
such as the aarch64 community box and hydra builders.
2021-10-14 19:41:32 +02:00
Ben Wolsieffer
a6c34ff363 linux: cleanup zlib conditional dependency
zlib was added to its own optional statement, when there was already another for
5.2
2021-10-08 20:09:58 -04:00
github-actions[bot]
5f4614a24e
Merge master into staging-next 2021-09-28 12:01:17 +00:00
Jörg Thalheim
c21ba4f7bb linux: fix cross-build dependencies
This is untested but according to
https://github.com/NixOS/nixpkgs/pull/127922#issuecomment-927346171

zlib is only used in the host build, which breaks cross-compilation if
not present.
2021-09-28 09:21:23 +00:00
Sandro
f0955beaff
Merge pull request #107525 from xaverdh/kernel-manual-config-fix 2021-09-21 22:12:11 +02:00
roblabla
34150f86c0 linux-kernel: Enable BTF
BTF is a new, lightweight debug information format tailored specifically
for the needs of eBPF, allowing eBPF programs to be portable across
various kernel versions, configurations and distributions. This is used
by bpftrace and lots of new eBPF-based tooling to avoid a dependency
on LLVM on the host.

BTF debug information is enabled on all major distributions: Fedora 31+,
RHEL 8.2+, Ubuntu 20.10, Debian 11 and ArchLinux all have enabled it.

Enabling BTF debug information requires adding two new dependencies to
the kernel build: Python3 and pahole. Those will be used to generate the
BTF debugging information.
2021-08-18 10:40:35 +02:00
Bernardo Meurer
ea167e8ccb
buildLinux: take and propagate extraMakeFlags
This is just for practicity, as it allows users of buildLinux to pass
along extra flags they need in the kernel's make invocation. This makes,
for example, supporting LLVM _much_ easier, and could enable us in the
future to provide clang-built kernels.
2021-07-12 10:39:52 -07:00
Bernardo Meurer
61ab7e84de
linuxManualConfig: patch all shebangs in scripts/
There are many scripts in `scripts/` which may be called by the build,
depending on how the user chooses to configure the kernel. For example,
`scripts/jobserver-exec` is called whenever the kernel is being built
with LLVM tooling, and without this patch that build will fail due to
the broken shebang.

This patch makes us fix _all_ scripts, as well as add a dependency on
python3Minimal, since a lot of the aforementioned scripts are written in
Python3 instead of shell.
2021-07-12 10:39:51 -07:00
Bernardo Meurer
31bb7be11a
linuxManualConfig: don't mangle --build-id
In order to have our linux builds be reproducible we patch the
`Makefile` to use `--build-id=none` as opposed to the default
`--build-id=sha1`. The way we've been doing this, however, caused the
flag to be mangled, and being set to `--build-id=none=sha1`. While bfd
seems to parse this normally, lld will loudly complain that the flag
does not exist:

```
linux>   LD      .tmp_vmlinux.kallsyms1
linux> ld.lld: error: unknown --build-id style: none=sha1
```

With this change the flag is now correctly set to `--build-id=none`.
2021-07-10 13:17:52 -07:00
Atemu
1b10b0d579 kernel: clarify license 2021-05-02 14:44:54 +00:00
Alyssa Ross
25208eeaba linux: remove xen_dom0 feature entirely
Xen is now enabled unconditionally on kernels that support it, so the
xen_dom0 feature doesn't do anything.  The isXen attribute will now
produce a deprecation warning and unconditionally return true.
Passing in a custom value for isXen is no longer supported.
2021-04-05 09:25:39 +00:00
John Ericson
9c213398b3 lib: Clean up how linux and gcc config is specified
Second attempt of 8929989614589ee3acd070a6409b2b9700c92d65; see that
commit for details.

This reverts commit 0bc275e634.
2021-01-23 10:01:28 -05:00
Jonathan Ringer
0bc275e634
Revert "lib: Clean up how linux and gcc config is specified"
This is a stdenv-rebuild, and should not be merged
into master

This reverts commit 8929989614.
2021-01-22 14:07:06 -08:00
John Ericson
8929989614 lib: Clean up how linux and gcc config is specified
The `platform` field is pointless nesting: it's just stuff that happens
to be defined together, and that should be an implementation detail.

This instead makes `linux-kernel` and `gcc` top level fields in platform
configs. They join `rustc` there [all are optional], which was put there
and not in `platform` in anticipation of a change like this.

`linux-kernel.arch` in particular also becomes `linuxArch`, to match the
other `*Arch`es.

The next step after is this to combine the *specific* machines from
`lib.systems.platforms` with `lib.systems.examples`, keeping just the
"multiplatform" ones for defaulting.
2021-01-21 22:44:09 -05:00
Ben Siraphob
16d91ee628 pkgs/os-specific: stdenv.lib -> lib 2021-01-17 23:26:08 +07:00
Dominik Xaver Hörl
2070808c4b linux/kernel/manual-config: prevent chmod errors when there is no arch specific Makefile
In such cases the glob pattern might not match anything and chmod will complain about the missing argument.
2020-12-31 11:05:32 +01:00
Blaž Hrastnik
9fee546667 kernel/manual-config: add zstd to nativeBuildDeps.
Required to build with zstd compression.

Refs #101108
2020-12-27 10:58:59 +01:00
Blaž Hrastnik
2d0ba1f54b kernel/manual-config: simplify ld-version sed with patchShebangs. 2020-12-27 10:58:57 +01:00
Arnout Engelen
de075d25c7
linux: omit build id (#106648)
Don't include an ​NT_GNU_BUILD_ID (that is randomly generated
at build time).

This improves the kernel reproducibility: when also disabling
the MOUDLE_SIG and SECURITY_LOCKDOWN_LSM options the build
is bit-by-bit reproducible.
2020-12-23 16:31:05 +01:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Jonathan Ringer
613adb0e88 kernel/linuxManualConfig: add variant metadata 2020-11-01 19:59:06 -08:00
Tim Steinbach
3088dcb148
linux: 5.9-rc8 -> 5.10-rc1 2020-10-27 14:29:21 -04:00
oxalica
b5212f8bf0
linux: remove dependency to utillinuxMinimal 2020-09-06 22:06:22 +08:00
Tim Steinbach
467fdc71e5
linux: 5.8-rc1 -> 5.8-rc2 2020-06-26 11:09:06 -04:00
Arian van Putten
d103dc4998 linux: do not depend on systemd indirectly
utillinux depends on systemd because:

* uuidd supports socket activation
* lslogins can show recent journal entries
* fstrim comes with a service file (and we use this in NixOS)
* logger can write journal entries
(See https://www.openembedded.org/pipermail/openembedded-core/2015-February/102069.html)

systemd doesn't depend on utillinux but on utillinuxMinimal which is a
version of utillinux without these features to avoid cyclic
dependencies.

With this change, the linux kernel (of which i don't fully understand
why it would depend on util-linux in the first place, but this was added in
https://github.com/NixOS/nixpkgs/pull/32137/files without too much
explanation) depends on the minimal version of util-linux too.

This makes it that every time we change build flags in systemd
the linux kernel doesn't have to wastefully rebuild.
2020-04-28 15:34:44 +02:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Linus Heckemann
a69064eebc linux: run make install in parallel
This improves build times significantly, from 20min to 9min on the
aarch64 community box.
2019-12-19 09:24:20 +01:00
John Ericson
2811b032d6 treewide: Make still dont* Variables are optional in most cases
Go beyond the obvious setup hooks now, with a bit of sed, with a skipped case:

 - cc-wrapper's `dontlink`, because it already is handled.

Also, in nix files escaping was manually added.

EMP
2019-11-01 14:44:44 -04:00
Tim Steinbach
ecb95c8bcb
linux: 5.4-rc1 -> 5.4-rc2 2019-10-08 13:18:51 -04:00
Dima
bdccffa81c linux_5_2, linux_5_3: fixing nondeterminism
In 5.2 kernel a new mechanism was introduced which embeds the kernel
headers in the kernel image and exposes them in procfs for simplified
use by userland tools.

It was introduced in
43d8ce9d65
and later modified a bit in
f7b101d330

The archive containing the header files had nondeterminism through the
header files metadata - specifically `mtime`, but I also decided to
normalize some other aspects just in case.

In our default setup we currently compile this as a module, so to expose
the headers to test the functionality `kheaders` needs to be loaded.

See https://lkml.org/lkml/2019/10/4/1036 and
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=fixes&id=2cc99c9cdc8fde5e92e34f9655829449cebd3e00

I commented out the documentation part of the patch to make it cleanly apply to
5.2 and 5.3, see remark in the patch itself.
2019-10-05 09:34:35 +02:00
Tim Steinbach
6d6c3f66b0 linux: 5.2-rc7 -> 5.3-rc5 2019-09-09 14:25:31 -04:00