From 3b16f345b5d82559b6a80256f6e72db01e9ffd06 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 13 Apr 2019 22:29:47 +0200 Subject: [PATCH 1/3] make-initrd: allow specifying name Also moves the argument defaults out of all-packages.nix and into make-initrd itself. --- pkgs/build-support/kernel/make-initrd.nix | 7 +++++-- pkgs/top-level/all-packages.nix | 5 +---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix index 22761af158a..7ad1affb65a 100644 --- a/pkgs/build-support/kernel/make-initrd.nix +++ b/pkgs/build-support/kernel/make-initrd.nix @@ -12,11 +12,14 @@ # `contents = {object = ...; symlink = /init;}' is a typical # argument. -{ stdenv, perl, cpio, contents, compressor, prepend, ubootTools +{ stdenv, perl, cpio, contents, ubootTools +, name ? "initrd" +, compressor ? "gzip -9n" +, prepend ? [] }: stdenv.mkDerivation rec { - name = "initrd"; + inherit name; builder = ./make-initrd.sh; makeUInitrd = stdenv.hostPlatform.platform.kernelTarget == "uImage"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c048f443161..7cdaf9962cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -330,10 +330,7 @@ in makeAutostartItem = callPackage ../build-support/make-startupitem { }; - makeInitrd = { contents, compressor ? "gzip -9n", prepend ? [ ] }: - callPackage ../build-support/kernel/make-initrd.nix { - inherit contents compressor prepend; - }; + makeInitrd = callPackage ../build-support/kernel/make-initrd.nix; # Args intentionally left out makeWrapper = makeSetupHook { deps = [ dieHook ]; substitutions = { shell = pkgs.runtimeShell; }; } ../build-support/setup-hooks/make-wrapper.sh; From 217cfbe11a399033557868d111fb020a888865d9 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 13 Apr 2019 23:22:07 +0200 Subject: [PATCH 2/3] aggregateModules: allow passing name --- pkgs/os-specific/linux/kmod/aggregator.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kmod/aggregator.nix b/pkgs/os-specific/linux/kmod/aggregator.nix index 7d46a13f356..afa8867dd07 100644 --- a/pkgs/os-specific/linux/kmod/aggregator.nix +++ b/pkgs/os-specific/linux/kmod/aggregator.nix @@ -1,7 +1,7 @@ -{ stdenv, kmod, modules, buildEnv }: +{ stdenv, kmod, modules, buildEnv, name ? "kernel-modules" }: buildEnv { - name = "kernel-modules"; + inherit name; paths = modules; From b499c52de54146998f0ab97288744584f0a49e7a Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 13 Apr 2019 23:22:56 +0200 Subject: [PATCH 3/3] stage-1: provide meaningful names to initrd and module tree --- nixos/modules/system/boot/stage-1.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 9984a97bbdd..8702abd3df8 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -11,7 +11,9 @@ let udev = config.systemd.package; - modulesTree = config.system.modulesTree; + kernel-name = config.boot.kernelPackages.kernel.name or "kernel"; + + modulesTree = config.system.modulesTree.override { name = kernel-name + "-modules"; }; firmware = config.hardware.firmware; @@ -290,6 +292,7 @@ let # The closure of the init script of boot stage 1 is what we put in # the initial RAM disk. initialRamdisk = pkgs.makeInitrd { + name = "initrd-${kernel-name}"; inherit (config.boot.initrd) compressor prepend; contents =