Accepting request 101505 from Base:System
- Update to version 39:
+ New systemd-cgtop tool to show control groups by their resource
usage.
+ Linking against libacl for ACLs is optional again.
+ If a group "adm" exists, journal files are automatically owned
by them, thus allow members of this group full access to the
system journal as well as all user journals.
+ The journal now stores the SELinux context of the logging
client for all entries.
+ Add C++ inclusion guards to all public headers.
+ New output mode "cat" in the journal to print only text
messages, without any meta data like date or time.
+ Include tiny X server wrapper as a temporary stop-gap to teach
XOrg udev display enumeration (until XOrg supports udev
hotplugging for display devices).
+ Add new systemd-cat tool for executing arbitrary programs with
STDERR/STDOUT connected to the journal. Can also act as BSD
logger replacement, and does so by default.
+ Optionally store all locally generated coredumps in the journal
along with meta data.
+ systemd-tmpfiles learnt four new commands: n, L, c, b, for
writing short strings to files (for usage for /sys), and for
creating symlinks, character and block device nodes.
+ New unit file option ControlGroupPersistent= to make cgroups
persistent.
+ Support multiple local RTCs in a sane way.
+ No longer monopolize IO when replaying readahead data on
rotating disks.
+ Don't show kernel threads in systemd-cgls anymore, unless
requested with new -k switch. (forwarded request 101496 from fcrozat)
OBS-URL: https://build.opensuse.org/request/show/101505
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=85
2012-01-26 16:00:42 +01:00
|
|
|
m 5c894bc1e45f7c34bf7fc4ca0d20bf1c3b679bef Mon Sep 17 00:00:00 2001
|
2011-08-25 10:07:26 +02:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Thu, 18 Aug 2011 18:28:01 +0200
|
|
|
|
Subject: [PATCH] handle disable_caplock and compose_table and kbd_rate
|
|
|
|
|
|
|
|
---
|
2011-08-29 09:14:27 +02:00
|
|
|
src/vconsole-setup.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
|
|
|
1 files changed, 121 insertions(+), 3 deletions(-)
|
2011-08-25 10:07:26 +02:00
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
Index: systemd-189/src/vconsole/vconsole-setup.c
|
2011-12-12 16:59:25 +01:00
|
|
|
===================================================================
|
2012-11-02 17:30:32 +01:00
|
|
|
--- systemd-189.orig/src/vconsole/vconsole-setup.c
|
|
|
|
+++ systemd-189/src/vconsole/vconsole-setup.c
|
2011-10-08 11:44:34 +02:00
|
|
|
@@ -40,6 +40,7 @@
|
2011-08-25 10:07:26 +02:00
|
|
|
#include "log.h"
|
|
|
|
#include "macro.h"
|
2011-10-08 11:44:34 +02:00
|
|
|
#include "virt.h"
|
2011-08-25 10:07:26 +02:00
|
|
|
+#include "strv.h"
|
|
|
|
|
|
|
|
static bool is_vconsole(int fd) {
|
|
|
|
unsigned char data[1];
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -99,8 +100,8 @@ static int enable_utf8(int fd) {
|
2011-08-25 10:07:26 +02:00
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int load_keymap(const char *vc, const char *map, const char *map_toggle, bool utf8, pid_t *_pid) {
|
|
|
|
- const char *args[8];
|
2011-08-29 09:14:27 +02:00
|
|
|
+static int load_keymap(const char *vc, const char *map, const char *map_toggle, bool utf8, bool disable_capslock, pid_t *_pid) {
|
|
|
|
+ const char *args[9];
|
2011-08-25 10:07:26 +02:00
|
|
|
int i = 0;
|
|
|
|
pid_t pid;
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -119,6 +120,8 @@ static int load_keymap(const char *vc, c
|
2011-08-25 10:07:26 +02:00
|
|
|
args[i++] = map;
|
|
|
|
if (map_toggle)
|
|
|
|
args[i++] = map_toggle;
|
|
|
|
+ if (disable_capslock)
|
|
|
|
+ args[i++] = "disable.capslock";
|
|
|
|
args[i++] = NULL;
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
pid = fork();
|
|
|
|
@@ -172,6 +175,101 @@ static int load_font(const char *vc, con
|
2011-08-25 10:07:26 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef TARGET_SUSE
|
2011-08-29 09:14:27 +02:00
|
|
|
+static int load_compose_table(const char *vc, const char *compose_table, pid_t *_pid) {
|
|
|
|
+ const char *args[1024];
|
2011-12-12 16:59:25 +01:00
|
|
|
+ int i = 0, j = 0;
|
2011-08-29 09:14:27 +02:00
|
|
|
+ pid_t pid;
|
|
|
|
+ char **strv_compose_table = NULL;
|
2011-12-12 16:59:25 +01:00
|
|
|
+ char *to_free[1024];
|
2011-08-29 09:14:27 +02:00
|
|
|
+
|
|
|
|
+ if (isempty(compose_table)) {
|
|
|
|
+ /* An empty map means no compose table*/
|
|
|
|
+ *_pid = 0;
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ args[i++] = KBD_LOADKEYS;
|
|
|
|
+ args[i++] = "-q";
|
|
|
|
+ args[i++] = "-C";
|
|
|
|
+ args[i++] = vc;
|
|
|
|
+
|
|
|
|
+ strv_compose_table = strv_split(compose_table, WHITESPACE);
|
|
|
|
+ if (strv_compose_table) {
|
|
|
|
+ bool compose_loaded = false;
|
|
|
|
+ bool compose_clear = false;
|
|
|
|
+ char **name;
|
|
|
|
+ char *arg;
|
|
|
|
+
|
|
|
|
+ STRV_FOREACH (name, strv_compose_table) {
|
|
|
|
+ if (streq(*name,"-c") || streq(*name,"clear")) {
|
|
|
|
+ compose_clear = true;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (!compose_loaded) {
|
|
|
|
+ if (compose_clear)
|
|
|
|
+ args[i++] = "-c";
|
|
|
|
+ }
|
|
|
|
+ asprintf(&arg, "compose.%s",*name);
|
|
|
|
+ compose_loaded = true;
|
2011-12-12 16:59:25 +01:00
|
|
|
+ args[i++] = to_free[j++] = arg;
|
2011-08-29 09:14:27 +02:00
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ strv_free(strv_compose_table);
|
|
|
|
+ }
|
|
|
|
+ args[i++] = NULL;
|
|
|
|
+
|
|
|
|
+ if ((pid = fork()) < 0) {
|
|
|
|
+ log_error("Failed to fork: %m");
|
|
|
|
+ return -errno;
|
|
|
|
+ } else if (pid == 0) {
|
|
|
|
+ execv(args[0], (char **) args);
|
|
|
|
+ _exit(EXIT_FAILURE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ *_pid = pid;
|
2011-12-12 16:59:25 +01:00
|
|
|
+
|
|
|
|
+ for (i=0 ; i < j ; i++)
|
|
|
|
+ free (to_free[i]);
|
|
|
|
+
|
2011-08-29 09:14:27 +02:00
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
2011-08-25 10:07:26 +02:00
|
|
|
+static int set_kbd_rate(const char *vc, const char *kbd_rate, const char *kbd_delay, pid_t *_pid) {
|
|
|
|
+ const char *args[7];
|
|
|
|
+ int i = 0;
|
|
|
|
+ pid_t pid;
|
|
|
|
+
|
|
|
|
+ if (isempty(kbd_rate) && isempty(kbd_delay)) {
|
|
|
|
+ *_pid = 0;
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ args[i++] = "/bin/kbdrate";
|
|
|
|
+ if (!isempty(kbd_rate)) {
|
|
|
|
+ args[i++] = "-r";
|
|
|
|
+ args[i++] = kbd_rate;
|
|
|
|
+ }
|
|
|
|
+ if (!isempty(kbd_delay)) {
|
|
|
|
+ args[i++] = "-d";
|
|
|
|
+ args[i++] = kbd_delay;
|
|
|
|
+ }
|
|
|
|
+ args[i++] = "-s";
|
|
|
|
+ args[i++] = NULL;
|
|
|
|
+
|
|
|
|
+ if ((pid = fork()) < 0) {
|
|
|
|
+ log_error("Failed to fork: %m");
|
|
|
|
+ return -errno;
|
|
|
|
+ } else if (pid == 0) {
|
|
|
|
+ execv(args[0], (char **) args);
|
|
|
|
+ _exit(EXIT_FAILURE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ *_pid = pid;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
const char *vc;
|
|
|
|
char *vc_keymap = NULL;
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -185,8 +283,16 @@ int main(int argc, char **argv) {
|
Accepting request 101505 from Base:System
- Update to version 39:
+ New systemd-cgtop tool to show control groups by their resource
usage.
+ Linking against libacl for ACLs is optional again.
+ If a group "adm" exists, journal files are automatically owned
by them, thus allow members of this group full access to the
system journal as well as all user journals.
+ The journal now stores the SELinux context of the logging
client for all entries.
+ Add C++ inclusion guards to all public headers.
+ New output mode "cat" in the journal to print only text
messages, without any meta data like date or time.
+ Include tiny X server wrapper as a temporary stop-gap to teach
XOrg udev display enumeration (until XOrg supports udev
hotplugging for display devices).
+ Add new systemd-cat tool for executing arbitrary programs with
STDERR/STDOUT connected to the journal. Can also act as BSD
logger replacement, and does so by default.
+ Optionally store all locally generated coredumps in the journal
along with meta data.
+ systemd-tmpfiles learnt four new commands: n, L, c, b, for
writing short strings to files (for usage for /sys), and for
creating symlinks, character and block device nodes.
+ New unit file option ControlGroupPersistent= to make cgroups
persistent.
+ Support multiple local RTCs in a sane way.
+ No longer monopolize IO when replaying readahead data on
rotating disks.
+ Don't show kernel threads in systemd-cgls anymore, unless
requested with new -k switch. (forwarded request 101496 from fcrozat)
OBS-URL: https://build.opensuse.org/request/show/101505
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=85
2012-01-26 16:00:42 +01:00
|
|
|
#if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
|
2011-08-25 10:07:26 +02:00
|
|
|
char *vc_keytable = NULL;
|
|
|
|
#endif
|
|
|
|
+#ifdef TARGET_SUSE
|
|
|
|
+ char *vc_kbd_delay = NULL;
|
|
|
|
+ char *vc_kbd_rate = NULL;
|
|
|
|
+ char *vc_kbd_disable_caps_lock = NULL;
|
2011-08-29 09:14:27 +02:00
|
|
|
+ char *vc_compose_table = NULL;
|
|
|
|
+ pid_t kbd_rate_pid = 0, compose_table_pid = 0;
|
2011-08-25 10:07:26 +02:00
|
|
|
+#endif
|
|
|
|
int fd = -1;
|
|
|
|
bool utf8;
|
|
|
|
+ bool disable_capslock = false;
|
|
|
|
int r = EXIT_FAILURE;
|
|
|
|
pid_t font_pid = 0, keymap_pid = 0;
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -281,10 +387,15 @@ int main(int argc, char **argv) {
|
|
|
|
free(vc_keymap);
|
|
|
|
vc_keymap = t;
|
2011-08-25 10:07:26 +02:00
|
|
|
}
|
2011-12-12 16:59:25 +01:00
|
|
|
+ disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
|
2011-08-25 10:07:26 +02:00
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
#elif defined(TARGET_SUSE)
|
|
|
|
r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
|
|
|
|
"KEYTABLE", &vc_keymap,
|
|
|
|
+ "KBD_DELAY", &vc_kbd_delay,
|
|
|
|
+ "KBD_RATE", &vc_kbd_rate,
|
|
|
|
+ "KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
|
|
|
|
+ "COMPOSETABLE", &vc_compose_table,
|
|
|
|
NULL);
|
|
|
|
if (r < 0 && r != -ENOENT)
|
|
|
|
log_warning("Failed to read /etc/sysconfig/keyboard: %s", strerror(-r));
|
|
|
|
@@ -443,7 +554,11 @@ int main(int argc, char **argv) {
|
2011-08-25 10:07:26 +02:00
|
|
|
disable_utf8(fd);
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
|
2011-08-25 10:07:26 +02:00
|
|
|
- if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid) >= 0 &&
|
2011-08-29 09:14:27 +02:00
|
|
|
+ if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, disable_capslock, &keymap_pid) >= 0 &&
|
2011-08-25 10:07:26 +02:00
|
|
|
+#ifdef TARGET_SUSE
|
2011-08-29 09:14:27 +02:00
|
|
|
+ load_compose_table(vc, vc_compose_table, &compose_table_pid) >= 0 &&
|
2011-08-25 10:07:26 +02:00
|
|
|
+ set_kbd_rate(vc, vc_kbd_rate, vc_kbd_delay, &kbd_rate_pid) >= 0 &&
|
|
|
|
+#endif
|
|
|
|
load_font(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid) >= 0)
|
|
|
|
r = EXIT_SUCCESS;
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -451,6 +566,14 @@ finish:
|
2011-08-25 10:07:26 +02:00
|
|
|
if (keymap_pid > 0)
|
|
|
|
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
|
|
|
|
|
|
|
|
+#ifdef TARGET_SUSE
|
2011-08-29 09:14:27 +02:00
|
|
|
+ if (compose_table_pid > 0)
|
|
|
|
+ wait_for_terminate_and_warn(KBD_LOADKEYS, compose_table_pid);
|
|
|
|
+
|
2011-08-25 10:07:26 +02:00
|
|
|
+ if (kbd_rate_pid > 0)
|
|
|
|
+ wait_for_terminate_and_warn("/bin/kbdrate", kbd_rate_pid);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
if (font_pid > 0)
|
|
|
|
wait_for_terminate_and_warn(KBD_SETFONT, font_pid);
|
|
|
|
|
2012-11-02 17:30:32 +01:00
|
|
|
@@ -458,6 +581,12 @@ finish:
|
2011-12-12 16:59:25 +01:00
|
|
|
free(vc_font);
|
|
|
|
free(vc_font_map);
|
|
|
|
free(vc_font_unimap);
|
|
|
|
+#ifdef TARGET_SUSE
|
|
|
|
+ free(vc_kbd_delay);
|
|
|
|
+ free(vc_kbd_rate);
|
|
|
|
+ free(vc_kbd_disable_caps_lock);
|
|
|
|
+ free(vc_compose_table);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (fd >= 0)
|
|
|
|
close_nointr_nofail(fd);
|