chiark / gitweb /
parse_env_file() - return empty value strings like FOO="" as NULL value
[elogind.git] / src / vconsole-setup.c
index 21f2401..7703361 100644 (file)
@@ -186,9 +186,9 @@ int main(int argc, char **argv) {
         }
 
         /* Hmm, nothing set on the kernel cmd line? Then let's
-         * try /etc/vconsole */
+         * try /etc/vconsole.conf */
         if (r <= 0 &&
-            (r = parse_env_file("/etc/vconsole", NEWLINE,
+            (r = parse_env_file("/etc/vconsole.conf", NEWLINE,
                                 "KEYMAP", &vc_keymap,
                                 "FONT", &vc_font,
                                 "FONT_MAP", &vc_font_map,
@@ -196,7 +196,7 @@ int main(int argc, char **argv) {
                                 NULL)) < 0) {
 
                 if (r != -ENOENT)
-                        log_warning("Failed to read /etc/vconsole: %s", strerror(-r));
+                        log_warning("Failed to read /etc/vconsole.conf: %s", strerror(-r));
         }
 
         if (r <= 0) {
@@ -232,6 +232,25 @@ int main(int argc, char **argv) {
                         vc_keymap = t;
                 }
 
+#elif defined(TARGET_SUSE)
+                if ((r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
+                                        "KEYTABLE", &vc_keymap,
+                                        NULL)) < 0) {
+
+                        if (r != -ENOENT)
+                                log_warning("Failed to read /etc/sysconfig/keyboard: %s", strerror(-r));
+                }
+
+                if ((r = parse_env_file("/etc/sysconfig/console", NEWLINE,
+                                        "CONSOLE_FONT", &vc_font,
+                                        "CONSOLE_SCREENMAP", &vc_font_map,
+                                        "CONSOLE_UNICODEMAP", &vc_font_unimap,
+                                        NULL)) < 0) {
+
+                        if (r != -ENOENT)
+                                log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
+                }
+
 #elif defined(TARGET_ARCH)
                 if ((r = parse_env_file("/etc/rc.conf", NEWLINE,
                                         "KEYMAP", &vc_keymap,