summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-16 01:58:16 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-16 01:58:16 +0200
commit1ebdf5b6847b6a52480a6e9382c1cb70f931a535 (patch)
treecdd284e430c75efa585e1ba5e7e804872341570f
parente7db37dd19d540e9ac8b89c689914d44d15433c4 (diff)
vconsole: fall back to fedora specific configuration
-rw-r--r--src/vconsole-setup.c52
1 files changed, 34 insertions, 18 deletions
diff --git a/src/vconsole-setup.c b/src/vconsole-setup.c
index 8e4fedef0e..cb8fc43d2f 100644
--- a/src/vconsole-setup.c
+++ b/src/vconsole-setup.c
@@ -168,31 +168,47 @@ int main(int argc, char **argv) {
if (!(utf8 = is_locale_utf8()))
disable_utf8(fd);
- if ((r = parse_env_file(
- "/etc/vconsole",
- NEWLINE,
- "VCONSOLE_KEYMAP", &vc_keymap,
- "VCONSOLE_FONT", &vc_font,
- "VCONSOLE_FONT_MAP", &vc_font_map,
- "VCONSOLE_FONT_UNIMAP", &vc_font_unimap,
- NULL)) < 0) {
+#ifdef TARGET_FEDORA
+ if ((r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
+ "SYSFONT", &vc_font,
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+
+ if ((r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
+ "KEYTABLE", &vc_keymap,
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+#endif
+
+ /* Override distribution-specific options with the
+ * distribution-independent configuration */
+ if ((r = parse_env_file("/etc/vconsole", NEWLINE,
+ "VCONSOLE_KEYMAP", &vc_keymap,
+ "VCONSOLE_FONT", &vc_font,
+ "VCONSOLE_FONT_MAP", &vc_font_map,
+ "VCONSOLE_FONT_UNIMAP", &vc_font_unimap,
+ NULL)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /etc/vconsole: %s", strerror(-r));
}
- if ((r = parse_env_file(
- "/proc/cmdline",
- WHITESPACE,
+ if ((r = parse_env_file("/proc/cmdline", WHITESPACE,
#ifdef TARGET_FEDORA
- "SYSFONT", &vc_font,
- "KEYTABLE", &vc_keymap,
+ "SYSFONT", &vc_font,
+ "KEYTABLE", &vc_keymap,
#endif
- "vconsole.keymap", &vc_keymap,
- "vconsole.font", &vc_font,
- "vconsole.font.map", &vc_font_map,
- "vconsole.font.unimap", &vc_font_unimap,
- NULL)) < 0) {
+ "vconsole.keymap", &vc_keymap,
+ "vconsole.font", &vc_font,
+ "vconsole.font.map", &vc_font_map,
+ "vconsole.font.unimap", &vc_font_unimap,
+ NULL)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /proc/cmdline: %s", strerror(-r));