* Updates for the dynamically linked splash helper.

svn path=/nixos/trunk/; revision=22087
This commit is contained in:
Eelco Dolstra 2010-06-01 16:38:42 +00:00
parent dc49a0ce3f
commit 9c900ee15c
1 changed files with 22 additions and 20 deletions

View File

@ -5,9 +5,9 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let with pkgs.lib;
inherit (pkgs.lib) mkOption types; let
options = { options = {
@ -37,7 +37,7 @@ let
boot.initrd.postDeviceCommands = mkOption { boot.initrd.postDeviceCommands = mkOption {
default = ""; default = "";
merge = pkgs.lib.mergeStringOption; merge = mergeStringOption;
description = '' description = ''
Shell commands to be executed immediately after stage 1 of the Shell commands to be executed immediately after stage 1 of the
boot has loaded kernel modules and created device nodes in boot has loaded kernel modules and created device nodes in
@ -47,7 +47,7 @@ let
boot.initrd.postMountCommands = mkOption { boot.initrd.postMountCommands = mkOption {
default = ""; default = "";
merge = pkgs.lib.mergeStringOption; merge = mergeStringOption;
description = '' description = ''
Shell commands to be executed immediately after the stage 1 Shell commands to be executed immediately after the stage 1
filesystems have been mounted. filesystems have been mounted.
@ -57,7 +57,7 @@ let
boot.initrd.extraUtilsCommands = mkOption { boot.initrd.extraUtilsCommands = mkOption {
internal = true; internal = true;
default = ""; default = "";
merge = pkgs.lib.mergeStringOption; merge = mergeStringOption;
description = '' description = ''
Shell commands to be executed in the builder of the Shell commands to be executed in the builder of the
extra-utils derivation. This can be used to provide extra-utils derivation. This can be used to provide
@ -90,6 +90,10 @@ let
}; };
enableSplashScreen =
config.boot.initrd.enableSplashScreen && kernelPackages.splashutils != null;
# Some additional utilities needed in stage 1, like mount, lvm, fsck # Some additional utilities needed in stage 1, like mount, lvm, fsck
# etc. We don't want to bring in all of those packages, so we just # etc. We don't want to bring in all of those packages, so we just
# copy what we need. Instead of using statically linked binaries, # copy what we need. Instead of using statically linked binaries,
@ -157,6 +161,11 @@ let
# Copy modprobe. # Copy modprobe.
cp -v ${pkgs.module_init_tools}/sbin/modprobe $out/bin/modprobe.real cp -v ${pkgs.module_init_tools}/sbin/modprobe $out/bin/modprobe.real
# Maybe copy splashutils.
${optionalString enableSplashScreen ''
cp ${kernelPackages.splashutils}/${kernelPackages.splashutils.helperName} $out/bin/splash_helper
''}
${config.boot.initrd.extraUtilsCommands} ${config.boot.initrd.extraUtilsCommands}
# Run patchelf to make the programs refer to the copied libraries. # Run patchelf to make the programs refer to the copied libraries.
@ -203,7 +212,7 @@ let
# The initrd only has to mount / or any FS marked as necessary for # The initrd only has to mount / or any FS marked as necessary for
# booting (such as the FS containing /nix/store, or an FS needed for # booting (such as the FS containing /nix/store, or an FS needed for
# mounting /, like / on a loopback). # mounting /, like / on a loopback).
fileSystems = pkgs.lib.filter fileSystems = filter
(fs: fs.mountPoint == "/" || fs.neededForBoot) (fs: fs.mountPoint == "/" || fs.neededForBoot)
config.fileSystems; config.fileSystems;
@ -281,22 +290,15 @@ let
# The closure of the init script of boot stage 1 is what we put in # The closure of the init script of boot stage 1 is what we put in
# the initial RAM disk. # the initial RAM disk.
initialRamdisk = pkgs.makeInitrd { initialRamdisk = pkgs.makeInitrd {
contents = [ contents =
{ object = bootStage1; [ { object = bootStage1;
symlink = "/init"; symlink = "/init";
} }
] ++ ] ++ optionals enableSplashScreen
pkgs.lib.optionals [ { object = extraUtils;
(config.boot.initrd.enableSplashScreen && kernelPackages.splashutils != null)
[
{ object = pkgs.runCommand "splashutils" {allowedReferences = []; buildInputs = [pkgs.nukeReferences];} ''
ensureDir $out/bin
cp ${kernelPackages.splashutils}/${kernelPackages.splashutils.helperName} $out/bin/splash_helper
nuke-refs $out/bin/*
'';
suffix = "/bin/splash_helper"; suffix = "/bin/splash_helper";
symlink = "/${kernelPackages.splashutils.helperName}"; symlink = "/${kernelPackages.splashutils.helperName}";
} # */ }
{ object = import ../../../lib/unpack-theme.nix { { object = import ../../../lib/unpack-theme.nix {
inherit (pkgs) stdenv; inherit (pkgs) stdenv;
theme = config.services.ttyBackgrounds.defaultTheme; theme = config.services.ttyBackgrounds.defaultTheme;