Merge pull request #59423 from lheckemann/initramfs-improvements

Initramfs improvements
This commit is contained in:
Linus Heckemann 2019-04-14 12:10:26 +02:00 committed by GitHub
commit 0fc80a576a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View File

@ -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 =

View File

@ -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";

View File

@ -1,7 +1,7 @@
{ stdenv, kmod, modules, buildEnv }:
{ stdenv, kmod, modules, buildEnv, name ? "kernel-modules" }:
buildEnv {
name = "kernel-modules";
inherit name;
paths = modules;

View File

@ -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;