From 82e1d0c8b1b82345703caaf69afe94a809586e63 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Sep 2013 17:33:52 +0200 Subject: [PATCH] Remove services.ttyBackgrounds This hasn't worked in a long time. --- doc/config-examples/x86_64-usbstick.nix | 6 - lib/unpack-theme.nix | 7 - lib/unpack-theme.sh | 18 --- .../cd-dvd/system-tarball-fuloong2f.nix | 2 - .../cd-dvd/system-tarball-sheevaplug.nix | 1 - modules/module-list.nix | 1 - modules/profiles/headless.nix | 1 - modules/services/misc/nixos-manual.nix | 6 - modules/services/misc/rogue.nix | 5 - modules/system/boot/kernel.nix | 5 +- modules/system/boot/stage-1.nix | 28 +--- modules/tasks/kbd.nix | 24 +-- modules/tasks/tty-backgrounds.nix | 148 ------------------ modules/virtualisation/xen-domU.nix | 3 - 14 files changed, 5 insertions(+), 250 deletions(-) delete mode 100644 lib/unpack-theme.nix delete mode 100644 lib/unpack-theme.sh delete mode 100644 modules/tasks/tty-backgrounds.nix diff --git a/doc/config-examples/x86_64-usbstick.nix b/doc/config-examples/x86_64-usbstick.nix index 492b7a841a1..f7d3f80189d 100644 --- a/doc/config-examples/x86_64-usbstick.nix +++ b/doc/config-examples/x86_64-usbstick.nix @@ -15,12 +15,6 @@ } ]; - services = { - ttyBackgrounds = { - enable = false; - }; - }; - fonts = { enableFontConfig = false; }; diff --git a/lib/unpack-theme.nix b/lib/unpack-theme.nix deleted file mode 100644 index 69d2eebe530..00000000000 --- a/lib/unpack-theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{stdenv, theme}: - -stdenv.mkDerivation { - name = "theme"; - builder = ./unpack-theme.sh; - inherit theme; -} diff --git a/lib/unpack-theme.sh b/lib/unpack-theme.sh deleted file mode 100644 index ca6e0b88ab9..00000000000 --- a/lib/unpack-theme.sh +++ /dev/null @@ -1,18 +0,0 @@ -source $stdenv/setup - -ensureDir $out - -(cd $out && unpackFile $theme) - -themeName=$(cd $out && ls) - -for i in $out/$themeName/config/*.cfg; do - echo "converting $i" - # Rewrite /etc paths. Also, the file names - # config/bootsplash-.cfg should be .cfg. - sed "s^/etc/bootsplash/themes^$out^g" < $i > $out/$themeName/$(basename $i | sed 's^.*-^^') -done - -rm $out/$themeName/config/*.cfg - -ln -s $themeName $out/default diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 968605734a1..85356118ce6 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -154,8 +154,6 @@ in jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; - services.ttyBackgrounds.enable = false; - boot.loader.grub.enable = false; boot.loader.generationsDir.enable = false; system.boot.loader.kernelFile = "vmlinux"; diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index ed78bc2a067..20fe4de2cd8 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -165,7 +165,6 @@ in # not be started by default on the installation CD because the # default root password is empty. services.openssh.enable = true; - services.ttyBackgrounds.enable = false; jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; # cpufrequtils fails to build on non-pc diff --git a/modules/module-list.nix b/modules/module-list.nix index a27febb7bc1..931b7988f8d 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -268,7 +268,6 @@ ./tasks/network-interfaces.nix ./tasks/scsi-link-power-management.nix ./tasks/swraid.nix - ./tasks/tty-backgrounds.nix ./virtualisation/libvirtd.nix ./virtualisation/nova.nix ./virtualisation/virtualbox-guest.nix diff --git a/modules/profiles/headless.nix b/modules/profiles/headless.nix index 9693e36d9eb..e9c48da1913 100644 --- a/modules/profiles/headless.nix +++ b/modules/profiles/headless.nix @@ -9,7 +9,6 @@ with pkgs.lib; sound.enable = false; boot.vesa = false; boot.initrd.enableSplashScreen = false; - services.ttyBackgrounds.enable = false; # Don't start a tty on the serial consoles. systemd.services."serial-getty@ttyS0".enable = false; diff --git a/modules/services/misc/nixos-manual.nix b/modules/services/misc/nixos-manual.nix index 90e596fdc50..38f1917a46a 100644 --- a/modules/services/misc/nixos-manual.nix +++ b/modules/services/misc/nixos-manual.nix @@ -108,12 +108,6 @@ in }; }; - services.ttyBackgrounds.specificThemes = mkIf cfg.showManual - [ { tty = "tty${cfg.ttyNumber}"; - theme = pkgs.themes "green"; - } - ]; - services.mingetty.helpLine = mkIf cfg.showManual "\nPress for the NixOS manual."; diff --git a/modules/services/misc/rogue.nix b/modules/services/misc/rogue.nix index c5cc8b4050d..94fa8850750 100644 --- a/modules/services/misc/rogue.nix +++ b/modules/services/misc/rogue.nix @@ -54,11 +54,6 @@ in }; }; - services.ttyBackgrounds.specificThemes = singleton - { tty = cfg.tty; - theme = pkgs.themes "theme-gnu"; - }; - }; } diff --git a/modules/system/boot/kernel.nix b/modules/system/boot/kernel.nix index 27da9c86995..4ceabb20df5 100644 --- a/modules/system/boot/kernel.nix +++ b/modules/system/boot/kernel.nix @@ -65,8 +65,7 @@ in }; boot.vesa = mkOption { - default = config.boot.kernelPackages.splashutils != null; - example = false; + default = false; description = '' Whether to activate VESA video mode on boot. ''; @@ -160,7 +159,7 @@ in # (so you don't need to reboot to have changes take effect). boot.kernelParams = [ "loglevel=${toString config.boot.consoleLogLevel}" ] ++ - optionals config.boot.vesa [ "splash=verbose" "vga=0x317" ]; + optionals config.boot.vesa [ "vga=0x317" ]; boot.kernel.sysctl."kernel.printk" = config.boot.consoleLogLevel; diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index ed06e6a38d0..3836d639513 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -23,9 +23,6 @@ let }; - enableSplashScreen = - config.boot.vesa && config.boot.initrd.enableSplashScreen && kernelPackages.splashutils != null; - needsCifsUtils = kernelPackages.kernel ? features && kernelPackages.kernel.features ? needsCifsUtils && kernelPackages.kernel.features.needsCifsUtils @@ -94,11 +91,6 @@ let cp -v ${pkgs.kmod}/bin/kmod $out/bin/ ln -s kmod $out/bin/modprobe - # Maybe copy splashutils. - ${optionalString enableSplashScreen '' - cp ${kernelPackages.splashutils}/${kernelPackages.splashutils.helperName} $out/bin/splash_helper - ''} - # Maybe copy cifs utils ${optionalString needsCifsUtils '' cp -v ${pkgs.cifs_utils}/sbin/mount.cifs $out/bin @@ -228,18 +220,7 @@ let { object = pkgs.writeText "mdadm.conf" config.boot.initrd.mdadmConf; symlink = "/etc/mdadm.conf"; } - ] ++ optionals enableSplashScreen - [ { object = extraUtils; - suffix = "/bin/splash_helper"; - symlink = "/${kernelPackages.splashutils.helperName}"; - } - { object = import ../../../lib/unpack-theme.nix { - inherit (pkgs) stdenv; - theme = config.services.ttyBackgrounds.defaultTheme; - }; - symlink = "/etc/splash"; - } - ]; + ]; }; in @@ -256,13 +237,6 @@ in "; }; - boot.initrd.enableSplashScreen = mkOption { - default = true; - description = " - Whether to show a nice splash screen while booting. - "; - }; - boot.initrd.checkJournalingFS = mkOption { default = true; type = types.bool; diff --git a/modules/tasks/kbd.nix b/modules/tasks/kbd.nix index 8de5f43edac..9f294a5f93e 100644 --- a/modules/tasks/kbd.nix +++ b/modules/tasks/kbd.nix @@ -4,19 +4,10 @@ with pkgs.lib; let - # think about where to put this chunk of code! - # required by other pieces as well - requiredTTYs = config.services.mingetty.ttys - ++ config.boot.extraTTYs - ++ [ config.services.syslogd.tty ]; - ttys = map (dev: "/dev/${dev}") requiredTTYs; - consoleFont = config.i18n.consoleFont; - consoleKeyMap = config.i18n.consoleKeyMap; - vconsoleConf = pkgs.writeText "vconsole.conf" '' - KEYMAP=${consoleKeyMap} - FONT=${consoleFont} + KEYMAP=${config.i18n.consoleKeyMap} + FONT=${config.i18n.consoleFont} ''; in @@ -42,15 +33,6 @@ in ''; }; - # dummy option so that requiredTTYs can be passed - requiredTTYs = mkOption { - default = []; - description = " - FIXME: find another place for this option. - FIXME: find a good description. - "; - }; - }; @@ -58,8 +40,6 @@ in config = { - inherit requiredTTYs; # pass it to ./modules/tasks/tty-backgrounds.nix - environment.systemPackages = [ pkgs.kbd ]; # Let systemd-vconsole-setup.service do the work of setting up the diff --git a/modules/tasks/tty-backgrounds.nix b/modules/tasks/tty-backgrounds.nix deleted file mode 100644 index aae2c279b1e..00000000000 --- a/modules/tasks/tty-backgrounds.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ config, pkgs, ... }: - -with pkgs.lib; - -let - - inherit (pkgs) stdenv; - - kernelPackages = config.boot.kernelPackages; - splashutils = kernelPackages.splashutils; - requiredTTYs = config.requiredTTYs; - - backgrounds = - let - - specificThemes = config.services.ttyBackgrounds.specificThemes; - - overriddenTTYs = map (x: x.tty) specificThemes; - - # Use the default theme for all the mingetty ttys and for the - # syslog tty, except those for which a specific theme is - # specified. - defaultTTYs = - filter (x: !(elem x overriddenTTYs)) requiredTTYs; - - in - (map (tty: { inherit tty; }) defaultTTYs) ++ specificThemes; - - themesUnpacked = stdenv.mkDerivation { - name = "splash-themes"; - builder = ./tty-backgrounds-combine.sh; - default = unpackTheme config.services.ttyBackgrounds.defaultTheme; - # !!! Should use XML here. - ttys = map (x: x.tty) backgrounds; - themes = map (x: if x ? theme then unpackTheme x.theme else "default") backgrounds; - }; - - unpackTheme = theme: import ../../lib/unpack-theme.nix { - inherit stdenv theme; - }; - -in - -{ - - ###### interface - - options = { - - services.ttyBackgrounds = { - - enable = mkOption { - default = true; - description = '' - Whether to enable graphical backgrounds for the virtual consoles. - ''; - }; - - defaultTheme = mkOption { - default = pkgs.fetchurl { - #url = http://www.bootsplash.de/files/themes/Theme-BabyTux.tar.bz2; - url = mirror://gentoo/distfiles/Theme-BabyTux.tar.bz2; - md5 = "a6d89d1c1cff3b6a08e2f526f2eab4e0"; - }; - description = '' - The default theme for the virtual consoles. Themes can be found - at . - ''; - }; - - specificThemes = mkOption { - default = [ ]; - description = '' - This option overrides the theme for specific virtual consoles. - ''; - }; - - }; - - }; - - - ###### implementation - - config = mkIf (config.boot.vesa && config.services.ttyBackgrounds.enable && splashutils != null) ( - mkAssert (splashutils != null) '' - The kernelPackages does not provide splashutils, as required by ttyBackgrounds. - Either provide kernelPackages with splashutils, or disable ttyBackgrounds. - '' { - - services.ttyBackgrounds.specificThemes = singleton - { tty = config.services.syslogd.tty; - theme = pkgs.themes "theme-gnu"; - }; - - environment.etc = singleton - { source = themesUnpacked; - target = "splash"; - }; - - jobs.ttyBackgrounds = - { name = "tty-backgrounds"; - - startOn = "started udev"; - - # Don't stop tty-backgrounds during shutdown; it's not needed, - # and it just causes intrusive blanking of the screen. - stopOn = ""; - - preStart = - '' - # Critical: tell the kernel where to find splash_helper. It calls - # this program every time we switch between consoles. - helperProcFile=${splashutils.helperProcFile} - if test -e /proc/sys/fbcondecor; then helperProcFile=/proc/sys/fbcondecor; fi - echo ${splashutils}/${splashutils.helperName} > $helperProcFile - - # For each console... - for tty in ${toString (map (x: x.tty) backgrounds)}; do - # Make sure that the console exists. - echo -n "" > /dev/$tty - - # Set the theme as determined by tty-backgrounds-combine.sh - # above. Note that splashutils needs a TTY number - # instead of a device name, hence the ''${tty:3}. - theme=$(readlink ${themesUnpacked}/$tty) - prevTheme=$(${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c getcfg | - sed 's/theme: *\(.*\)/\1/;t;d' || true) - if [ "$theme" != "$prevTheme" ]; then - ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true - fi - ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setpic -t $theme || true - ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c on || true - done - ''; - - postStop = - '' - # Disable the theme on each console. - for tty in ${toString (map (x: x.tty) backgrounds)}; do - ${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c off || true - done - ''; - }; - - }); - -} diff --git a/modules/virtualisation/xen-domU.nix b/modules/virtualisation/xen-domU.nix index 1a9d67d7204..48358966934 100644 --- a/modules/virtualisation/xen-domU.nix +++ b/modules/virtualisation/xen-domU.nix @@ -11,9 +11,6 @@ boot.initrd.kernelModules = [ "xen-blkfront" ]; - # Backgrounds don't work, so don't bother. - services.ttyBackgrounds.enable = false; - # Send syslog messages to the Xen console. services.syslogd.tty = "hvc0";