* Updated the splash screen support for Linux >= 2.6.25.

svn path=/nixos/trunk/; revision=12030
This commit is contained in:
Eelco Dolstra 2008-06-10 16:10:23 +00:00
parent a49eb4d1f9
commit a20f4aff60
3 changed files with 32 additions and 32 deletions

View File

@ -121,14 +121,15 @@ rec {
} }
] ++ ] ++
pkgs.lib.optionals pkgs.lib.optionals
(config.boot.initrd.enableSplashScreen && kernelPackages.kernel.features ? fbSplash) (config.boot.initrd.enableSplashScreen && kernelPackages.splashutils != null)
[ [
{ object = pkgs.runCommand "splashutils" {} '' { object = pkgs.runCommand "splashutils" {allowedReferences = []; buildInputs = [pkgs.nukeReferences];} ''
ensureDir $out/bin ensureDir $out/bin
cp ${kernelPackages.splashutils}/bin/splash_helper $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 = "/sbin/splash_helper"; symlink = "/${kernelPackages.splashutils.helperName}";
} }
{ object = import ../helpers/unpack-theme.nix { { object = import ../helpers/unpack-theme.nix {
inherit (pkgs) stdenv; inherit (pkgs) stdenv;

View File

@ -409,7 +409,7 @@ let
) )
# Transparent TTY backgrounds. # Transparent TTY backgrounds.
++ optional (config.services.ttyBackgrounds.enable && kernelPackages.kernel.features ? fbSplash) ++ optional (config.services.ttyBackgrounds.enable && kernelPackages.splashutils != null)
(import ../upstart-jobs/tty-backgrounds.nix { (import ../upstart-jobs/tty-backgrounds.nix {
inherit (pkgs) stdenv; inherit (pkgs) stdenv;
inherit (kernelPackages) splashutils; inherit (kernelPackages) splashutils;

View File

@ -21,39 +21,38 @@ rec {
} }
]; ];
job = " job = ''
start on hardware-scan start on hardware-scan
start script start script
# Critical: tell the kernel where to find splash_helper. It calls # Critical: tell the kernel where to find splash_helper. It calls
# this program every time we switch between consoles. # this program every time we switch between consoles.
echo ${splashutils}/bin/splash_helper > /proc/sys/kernel/fbsplash echo ${splashutils}/${splashutils.helperName} > ${splashutils.helperProcFile}
# For each console... # For each console...
for tty in ${toString (map (x: x.tty) backgrounds)}; do for tty in ${toString (map (x: x.tty) backgrounds)}; do
# Make sure that the console exists. # Make sure that the console exists.
echo -n '' > /dev/tty$tty echo -n "" > /dev/tty$tty
# Set the theme as determined by tty-backgrounds-combine.sh # Set the theme as determined by tty-backgrounds-combine.sh
# above. # above.
theme=$(readlink ${themesUnpacked}/$tty) theme=$(readlink ${themesUnpacked}/$tty)
${splashutils}/bin/splash_util --tty $tty -c setcfg -t $theme || true ${splashutils}/${splashutils.controlName} --tty $tty -c setcfg -t $theme || true
${splashutils}/bin/splash_util --tty $tty -c setpic -t $theme || true ${splashutils}/${splashutils.controlName} --tty $tty -c setpic -t $theme || true
${splashutils}/bin/splash_util --tty $tty -c on || true ${splashutils}/${splashutils.controlName} --tty $tty -c on || true
done done
end script end script
respawn sleep 10000 # !!! Hack respawn sleep 10000 # !!! Hack
stop script stop script
# Disable the theme on each console. # Disable the theme on each console.
for tty in ${toString (map (x: x.tty) backgrounds)}; do for tty in ${toString (map (x: x.tty) backgrounds)}; do
${splashutils}/bin/splash_util --tty $tty -c off || true ${splashutils}/${splashutils.controlName} --tty $tty -c off || true
done done
end script end script
'';
";
} }