From 33be5ae29e9a1a48066b9ef5b84f9f2a2adb3d24d091a8ba203f749e4f5173cc Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 10 Mar 2016 08:05:23 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=930 --- ...lock-value-in-etc-sysconfig-keyboard.patch | 19 +++++++++++-------- systemd-mini.changes | 7 +++++++ systemd.changes | 7 +++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/handle-numlock-value-in-etc-sysconfig-keyboard.patch b/handle-numlock-value-in-etc-sysconfig-keyboard.patch index 18fd4f61..e3d7c312 100644 --- a/handle-numlock-value-in-etc-sysconfig-keyboard.patch +++ b/handle-numlock-value-in-etc-sysconfig-keyboard.patch @@ -134,7 +134,7 @@ Index: systemd-228/src/vconsole/vconsole-setup.c "COMPOSETABLE", &vc_compose_table, NULL); if (r < 0 && r != -ENOENT) -@@ -421,6 +428,32 @@ int main(int argc, char **argv) { +@@ -421,6 +428,35 @@ int main(int argc, char **argv) { disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0; @@ -146,28 +146,31 @@ Index: systemd-228/src/vconsole/vconsole-setup.c + + fdmem = open ("/dev/mem", O_RDONLY); + if (fdmem < 0) { -+ log_error("Failed to open /dev/mem: %m"); -+ return EXIT_FAILURE; ++ log_warning_errno(errno, "Failed to open /dev/mem: %m"); ++ goto finish; + } + + if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) { -+ log_error("Failed to seek /dev/mem: %m"); -+ return EXIT_FAILURE; ++ log_warning_errno(errno, "Failed to seek /dev/mem: %m"); ++ goto finish; + } + + if (read(fdmem, &c, sizeof(char)) == -1) { -+ log_error("Failed to read /dev/mem: %m"); -+ return EXIT_FAILURE; ++ log_warning_errno(errno, "Failed to read /dev/mem: %m"); ++ goto finish; + } + + if (c & BDA_KSF4_NUMLOCK_MASK) + numlock = true; ++ finish: ++ if (fdmem >= 0) ++ close(fdmem); + } +#endif /* x86 */ #endif /* HAVE_SYSV_COMPAT */ r = parse_env_file("/etc/vconsole.conf", NEWLINE, -@@ -456,6 +489,10 @@ int main(int argc, char **argv) { +@@ -456,6 +492,10 @@ int main(int argc, char **argv) { 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, disable_capslock) > 0; diff --git a/systemd-mini.changes b/systemd-mini.changes index 85ab0ea5..1de53cc5 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 10 08:01:57 UTC 2016 - werner@suse.de + +- Modify patch handle-numlock-value-in-etc-sysconfig-keyboard.patch + to allow that open, seek, and read of /dev/mem may fail e.g. + on XEN based virtual guests (bsc#961120) + ------------------------------------------------------------------- Tue Mar 1 09:16:08 UTC 2016 - werner@suse.de diff --git a/systemd.changes b/systemd.changes index 85ab0ea5..1de53cc5 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 10 08:01:57 UTC 2016 - werner@suse.de + +- Modify patch handle-numlock-value-in-etc-sysconfig-keyboard.patch + to allow that open, seek, and read of /dev/mem may fail e.g. + on XEN based virtual guests (bsc#961120) + ------------------------------------------------------------------- Tue Mar 1 09:16:08 UTC 2016 - werner@suse.de