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.
This commit is contained in:
Arian van Putten 2020-04-28 15:08:13 +02:00
parent 20e67f1fb8
commit d103dc4998

View file

@ -1,6 +1,6 @@
{ buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
, libelf, cpio
, utillinux
, utillinuxMinimal
, writeTextFile
}:
@ -281,7 +281,7 @@ let
in
assert stdenv.lib.versionAtLeast version "4.14" -> libelf != null;
assert stdenv.lib.versionAtLeast version "4.15" -> utillinux != null;
assert stdenv.lib.versionAtLeast version "4.15" -> utillinuxMinimal != null;
stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches configfile) // {
pname = "linux";
inherit version;
@ -292,7 +292,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr ]
++ optional (stdenv.hostPlatform.platform.kernelTarget == "uImage") buildPackages.ubootTools
++ optional (stdenv.lib.versionAtLeast version "4.14") libelf
++ optional (stdenv.lib.versionAtLeast version "4.15") utillinux
++ optional (stdenv.lib.versionAtLeast version "4.15") utillinuxMinimal
++ optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ]
++ optional (stdenv.lib.versionAtLeast version "5.2") cpio
;