[systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

Ray Strode halfline at gmail.com
Wed Nov 5 06:48:13 PST 2014


From: Ray Strode <rstrode at redhat.com>

The initialization performed by systemd-vconsole-setup is reset
when changing console drivers (say from vgacon to fbcon), so we
need to run it in that case.

See
http://lists.freedesktop.org/archives/systemd-devel/2014-October/023919.html
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024423.html
http://lists.freedesktop.org/archives/systemd-devel/2014-November/024881.html

This commit adds a udev rule to 99-systemd.rules to make
systemd-vconsole-setup get run when the fbcon device becomes available.
---
 rules/99-systemd.rules.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index e30d9a8..4763b65 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -1,39 +1,43 @@
 #  This file is part of systemd.
 #
 #  systemd is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU Lesser General Public License as published by
 #  the Free Software Foundation; either version 2.1 of the License, or
 #  (at your option) any later version.
 
 ACTION=="remove", GOTO="systemd_end"
 
+# Kernel resets vconsole state when changing console drivers so run
+# systemd-vconsole-setup when fbcon loads
+SUBSYSTEM=="graphics", KERNEL=="fbcon", RUN+="/usr/lib/systemd/systemd-vconsole-setup"
+
 SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"
 
 KERNEL=="vport*", TAG+="systemd"
 
 SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd"
 SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
 
 # Ignore encrypted devices with no identified superblock on it, since
 # we are probably still calling mke2fs or mkswap on it.
 SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
 
 # Ignore raid devices that are not yet assembled and started
 SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
 SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
 
 # Ignore loop devices that don't have any file attached
 SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"
 
 # Ignore nbd devices in the "add" event, with "change" the nbd is ready
 ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"
 
 # We need a hardware independent way to identify network devices. We
 # use the /sys/subsystem path for this. Current vanilla kernels don't
 # actually support that hierarchy right now, however upcoming kernels
 # will. HAL and udev internally support /sys/subsystem already, hence
 # it should be safe to use this here, too. This is mostly just an
 # identification string for systemd, so whether the path actually is
 # accessible or not does not matter as long as it is unique and in the
 # filesystem namespace.
 #
-- 
2.1.0



More information about the systemd-devel mailing list