diff --git a/system/system.nix b/system/system.nix index 590189f9abbb..7a40ba7c8850 100644 --- a/system/system.nix +++ b/system/system.nix @@ -121,14 +121,15 @@ rec { } ] ++ 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 - 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"; - symlink = "/sbin/splash_helper"; + symlink = "/${kernelPackages.splashutils.helperName}"; } { object = import ../helpers/unpack-theme.nix { inherit (pkgs) stdenv; diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index f7117f616aec..0169b8b13c04 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -409,7 +409,7 @@ let ) # 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 { inherit (pkgs) stdenv; inherit (kernelPackages) splashutils; diff --git a/upstart-jobs/tty-backgrounds.nix b/upstart-jobs/tty-backgrounds.nix index 6debe9e8f44e..d83291d7a05f 100644 --- a/upstart-jobs/tty-backgrounds.nix +++ b/upstart-jobs/tty-backgrounds.nix @@ -21,39 +21,38 @@ rec { } ]; - job = " -start on hardware-scan + job = '' + start on hardware-scan -start script + start script - # Critical: tell the kernel where to find splash_helper. It calls - # this program every time we switch between consoles. - echo ${splashutils}/bin/splash_helper > /proc/sys/kernel/fbsplash + # Critical: tell the kernel where to find splash_helper. It calls + # this program every time we switch between consoles. + echo ${splashutils}/${splashutils.helperName} > ${splashutils.helperProcFile} - # For each console... - for tty in ${toString (map (x: x.tty) backgrounds)}; do - # Make sure that the console exists. - echo -n '' > /dev/tty$tty + # For each console... + for tty in ${toString (map (x: x.tty) backgrounds)}; do + # Make sure that the console exists. + echo -n "" > /dev/tty$tty - # Set the theme as determined by tty-backgrounds-combine.sh - # above. - theme=$(readlink ${themesUnpacked}/$tty) - ${splashutils}/bin/splash_util --tty $tty -c setcfg -t $theme || true - ${splashutils}/bin/splash_util --tty $tty -c setpic -t $theme || true - ${splashutils}/bin/splash_util --tty $tty -c on || true - done + # Set the theme as determined by tty-backgrounds-combine.sh + # above. + theme=$(readlink ${themesUnpacked}/$tty) + ${splashutils}/${splashutils.controlName} --tty $tty -c setcfg -t $theme || true + ${splashutils}/${splashutils.controlName} --tty $tty -c setpic -t $theme || true + ${splashutils}/${splashutils.controlName} --tty $tty -c on || true + done -end script + end script -respawn sleep 10000 # !!! Hack + respawn sleep 10000 # !!! Hack -stop script - # Disable the theme on each console. - for tty in ${toString (map (x: x.tty) backgrounds)}; do - ${splashutils}/bin/splash_util --tty $tty -c off || true - done -end script - - "; + stop script + # Disable the theme on each console. + for tty in ${toString (map (x: x.tty) backgrounds)}; do + ${splashutils}/${splashutils.controlName} --tty $tty -c off || true + done + end script + ''; }