mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
Merge pull request #3828 from keszybz/drop-systemd-vconsole-setup-service
Update documentation for systemd-vconsole-setup
This commit is contained in:
commit
5e0bb1a628
@ -224,15 +224,14 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>vconsole.keymap=</varname></term>
|
||||
<term><varname>vconsole.keymap.toggle=</varname></term>
|
||||
<term><varname>vconsole.keymap_toggle=</varname></term>
|
||||
<term><varname>vconsole.font=</varname></term>
|
||||
<term><varname>vconsole.font.map=</varname></term>
|
||||
<term><varname>vconsole.font.unimap=</varname></term>
|
||||
<term><varname>vconsole.font_map=</varname></term>
|
||||
<term><varname>vconsole.font_unimap=</varname></term>
|
||||
|
||||
<listitem>
|
||||
<para>Parameters understood by the virtual console setup
|
||||
logic. For details, see
|
||||
<citerefentry><refentrytitle>systemd-vconsole-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
|
||||
<para>Parameters understood by the virtual console setup logic. For details, see
|
||||
<citerefentry><refentrytitle>vconsole.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -63,41 +63,7 @@
|
||||
|
||||
<para>See
|
||||
<citerefentry><refentrytitle>vconsole.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
for information about the configuration files understood by this
|
||||
service.</para>
|
||||
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Kernel Command Line</title>
|
||||
|
||||
<para>A few configuration parameters from
|
||||
<filename>vconsole.conf</filename> may be overridden on the kernel
|
||||
command line:</para>
|
||||
|
||||
<variablelist class='kernel-commandline-options'>
|
||||
<varlistentry>
|
||||
<term><varname>vconsole.keymap=</varname></term>
|
||||
<term><varname>vconsole.keymap.toggle=</varname></term>
|
||||
|
||||
<listitem><para>Overrides the key mapping table for the
|
||||
keyboard and the second toggle keymap.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
||||
<term><varname>vconsole.font=</varname></term>
|
||||
<term><varname>vconsole.font.map=</varname></term>
|
||||
<term><varname>vconsole.font.unimap=</varname></term>
|
||||
|
||||
<listitem><para>Configures the console font, the console map,
|
||||
and the unicode font map.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>See
|
||||
<citerefentry><refentrytitle>vconsole.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
for information about these settings.</para>
|
||||
for information about the configuration files and kernel command line options understood by this program.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
|
@ -57,8 +57,6 @@
|
||||
the virtual console, i.e. keyboard mapping and console font. It is
|
||||
applied at boot by udev using <filename>90-vconsole.rules</filename> file.
|
||||
You can safely mask this file if you want to avoid this kind of initialization.
|
||||
There is also <citerefentry><refentrytitle>systemd-vconsole-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
provided that you can conveniently use at any time to [re]initialize consoles.
|
||||
</para>
|
||||
|
||||
<para>The basic file format of the
|
||||
@ -93,12 +91,10 @@
|
||||
<term><varname>KEYMAP=</varname></term>
|
||||
<term><varname>KEYMAP_TOGGLE=</varname></term>
|
||||
|
||||
<listitem><para>Configures the key mapping table for the
|
||||
keyboard. <varname>KEYMAP=</varname> defaults to
|
||||
<literal>us</literal> if not set. The
|
||||
<varname>KEYMAP_TOGGLE=</varname> can be used to configure a
|
||||
second toggle keymap and is by default
|
||||
unset.</para></listitem>
|
||||
<listitem><para>Configures the key mapping table for the keyboard.
|
||||
<varname>KEYMAP=</varname> defaults to <literal>us</literal> if not set. The
|
||||
<varname>KEYMAP_TOGGLE=</varname> can be used to configure a second toggle keymap and is by
|
||||
default unset.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
@ -113,6 +109,32 @@
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Kernel Command Line</title>
|
||||
|
||||
<para>A few configuration parameters from <filename>vconsole.conf</filename> may be overridden
|
||||
on the kernel command line:</para>
|
||||
|
||||
<variablelist class='kernel-commandline-options'>
|
||||
<varlistentry>
|
||||
<term><varname>vconsole.keymap=</varname></term>
|
||||
<term><varname>vconsole.keymap_toggle=</varname></term>
|
||||
|
||||
<listitem><para>Overrides <varname>KEYMAP=</varname> and <varname>KEYMAP_TOGGLE=</varname>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
||||
<term><varname>vconsole.font=</varname></term>
|
||||
<term><varname>vconsole.font_map=</varname></term>
|
||||
<term><varname>vconsole.font_unimap=</varname></term>
|
||||
|
||||
<listitem><para>Overrides <varname>FONT=</varname>, <varname>FONT_MAP=</varname>, and
|
||||
<varname>FONT_UNIMAP=</varname>.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Example</title>
|
||||
|
||||
|
@ -61,6 +61,10 @@ static inline const char* one_zero(bool b) {
|
||||
return b ? "1" : "0";
|
||||
}
|
||||
|
||||
static inline const char* enable_disable(bool b) {
|
||||
return b ? "enable" : "disable";
|
||||
}
|
||||
|
||||
void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
|
||||
|
||||
bool plymouth_running(void);
|
||||
|
@ -1094,7 +1094,7 @@ static int verb_status(int argc, char *argv[], void *userdata) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to query secure boot status: %m");
|
||||
else
|
||||
printf(" Secure Boot: %s\n", r ? "enabled" : "disabled");
|
||||
printf(" Secure Boot: %sd\n", enable_disable(r));
|
||||
|
||||
r = is_efi_secure_boot_setup_mode();
|
||||
if (r < 0)
|
||||
|
@ -1564,7 +1564,7 @@ int main(int argc, char **argv) {
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed to enable watchdog: %m");
|
||||
else
|
||||
log_debug("Watchdog is %s.", r > 0 ? "enabled" : "disabled");
|
||||
log_debug("Watchdog is %sd.", enable_disable(r > 0));
|
||||
|
||||
log_debug("%s running as pid "PID_FMT,
|
||||
program_invocation_short_name, getpid());
|
||||
|
@ -256,12 +256,8 @@ static int link_enable_ipv6(Link *link) {
|
||||
r = write_string_file(p, one_zero(disabled), WRITE_STRING_FILE_VERIFY_ON_FAILURE);
|
||||
if (r < 0)
|
||||
log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m", disabled ? "disable" : "enable", link->ifname);
|
||||
else {
|
||||
if (disabled)
|
||||
log_link_info(link, "IPv6 disabled for interface: %m");
|
||||
else
|
||||
log_link_info(link, "IPv6 enabled for interface: %m");
|
||||
}
|
||||
else
|
||||
log_link_info(link, "IPv6 %sd for interface: %m", enable_disable(!disabled));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ static int method_set_ntp(sd_bus_message *m, void *userdata, sd_bus_error *error
|
||||
return r;
|
||||
|
||||
c->use_ntp = enabled;
|
||||
log_info("Set NTP to %s", enabled ? "enabled" : "disabled");
|
||||
log_info("Set NTP to %sd", enable_disable(enabled));
|
||||
|
||||
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m), "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP", NULL);
|
||||
|
||||
|
@ -83,17 +83,19 @@ static bool is_settable(int fd) {
|
||||
return r == 0 && IN_SET(curr_mode, K_XLATE, K_UNICODE);
|
||||
}
|
||||
|
||||
static int toggle_utf8(int fd, bool utf8) {
|
||||
static int toggle_utf8(const char *name, int fd, bool utf8) {
|
||||
int r;
|
||||
struct termios tc = {};
|
||||
|
||||
assert(name);
|
||||
|
||||
r = ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE);
|
||||
if (r < 0)
|
||||
return log_warning_errno(errno, "Failed to %s UTF-8 kbdmode: %m", utf8 ? "enable" : "disable");
|
||||
return log_warning_errno(errno, "Failed to %s UTF-8 kbdmode on %s: %m", enable_disable(utf8), name);
|
||||
|
||||
r = loop_write(fd, utf8 ? "\033%G" : "\033%@", 3, false);
|
||||
if (r < 0)
|
||||
return log_warning_errno(r, "Failed to %s UTF-8 term processing: %m", utf8 ? "enable" : "disable");
|
||||
return log_warning_errno(r, "Failed to %s UTF-8 term processing on %s: %m", enable_disable(utf8), name);
|
||||
|
||||
r = tcgetattr(fd, &tc);
|
||||
if (r >= 0) {
|
||||
@ -104,8 +106,9 @@ static int toggle_utf8(int fd, bool utf8) {
|
||||
r = tcsetattr(fd, TCSANOW, &tc);
|
||||
}
|
||||
if (r < 0)
|
||||
return log_warning_errno(errno, "Failed to %s iutf8 flag: %m", utf8 ? "enable" : "disable");
|
||||
return log_warning_errno(errno, "Failed to %s iutf8 flag on %s: %m", enable_disable(utf8), name);
|
||||
|
||||
log_debug("UTF-8 kbdmode %sd on %s", enable_disable(utf8), name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -114,8 +117,10 @@ static int toggle_utf8_sysfs(bool utf8) {
|
||||
|
||||
r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", utf8 ? "enable" : "disable");
|
||||
return r;
|
||||
return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
|
||||
|
||||
log_debug("Sysfs UTF-8 flag %sd", enable_disable(utf8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int keyboard_load_and_wait(const char *vc, const char *map, const char *map_toggle, bool utf8) {
|
||||
@ -266,7 +271,7 @@ static void setup_remaining_vcs(int fd, bool utf8) {
|
||||
if (!is_settable(fd_d))
|
||||
continue;
|
||||
|
||||
toggle_utf8(fd_d, utf8);
|
||||
toggle_utf8(ttyname, fd_d, utf8);
|
||||
|
||||
if (cfo.op != KD_FONT_OP_SET)
|
||||
continue;
|
||||
@ -281,13 +286,18 @@ static void setup_remaining_vcs(int fd, bool utf8) {
|
||||
/* unimapd is a ushort count and a pointer to an
|
||||
array of struct unipair { ushort, ushort } */
|
||||
r = ioctl(fd_d, PIO_UNIMAPCLR, &adv);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
log_warning_errno(errno, "PIO_UNIMAPCLR failed, unimaps might be incorrect for tty%i: %m", i);
|
||||
else {
|
||||
r = ioctl(fd_d, PIO_UNIMAP, &unimapd);
|
||||
if (r < 0)
|
||||
log_warning_errno(errno, "PIO_UNIMAP failed, unimaps might be incorrect for tty%i: %m", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
r = ioctl(fd_d, PIO_UNIMAP, &unimapd);
|
||||
if (r < 0) {
|
||||
log_warning_errno(errno, "PIO_UNIMAP failed, unimaps might be incorrect for tty%i: %m", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
log_debug("Font and unimap successfully copied to %s", ttyname);
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +376,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
toggle_utf8_sysfs(utf8);
|
||||
toggle_utf8(fd, utf8);
|
||||
toggle_utf8(vc, fd, utf8);
|
||||
font_ok = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap) == 0;
|
||||
keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle, utf8) == 0;
|
||||
|
||||
@ -374,7 +384,7 @@ int main(int argc, char **argv) {
|
||||
if (font_ok)
|
||||
setup_remaining_vcs(fd, utf8);
|
||||
else
|
||||
log_warning("Setting source virtual console failed, ignoring remaining ones.");
|
||||
log_warning("Setting source virtual console failed, ignoring remaining ones");
|
||||
}
|
||||
|
||||
return font_ok && keyboard_ok ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user