From d103dc49986ed4c7a242a832d4f74a85062e2395 Mon Sep 17 00:00:00 2001 From: Arian van Putten Date: Tue, 28 Apr 2020 15:08:13 +0200 Subject: [PATCH] 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. --- pkgs/os-specific/linux/kernel/manual-config.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 71505840b869..d73e0a8ac909 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -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 ;