diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hostname-setup.c | 4 | ||||
-rw-r--r-- | src/locale-setup.c | 10 | ||||
-rw-r--r-- | src/util.c | 15 | ||||
-rw-r--r-- | src/vconsole-setup.c | 18 |
4 files changed, 45 insertions, 2 deletions
diff --git a/src/hostname-setup.c b/src/hostname-setup.c index 0428a64fea..8b0ff79384 100644 --- a/src/hostname-setup.c +++ b/src/hostname-setup.c @@ -30,7 +30,7 @@ #include "util.h" #include "log.h" -#if defined(TARGET_FEDORA) +#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) #define FILENAME "/etc/sysconfig/network" #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) || defined(TARGET_FRUGALWARE) #define FILENAME "/etc/HOSTNAME" @@ -87,7 +87,7 @@ static int read_and_strip_hostname(const char *path, char **hn) { static int read_distro_hostname(char **hn) { -#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) +#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) int r; FILE *f; diff --git a/src/locale-setup.c b/src/locale-setup.c index 086647b720..9ac68d2f39 100644 --- a/src/locale-setup.c +++ b/src/locale-setup.c @@ -155,6 +155,16 @@ int locale_setup(void) { log_warning("Failed to read /etc/rc.conf: %s", strerror(-r)); } +#elif defined(TARGET_ALTLINUX) + if (r <= 0 && + (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE, + "LANG", &variables[VARIABLE_LANG], + NULL)) < 0) { + + if (r != -ENOENT) + log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r)); + } + #elif defined(TARGET_GENTOO) /* Gentoo's openrc expects locale variables in /etc/env.d/ * These files are later compiled by env-update into shell diff --git a/src/util.c b/src/util.c index ef37d05751..7692a2d620 100644 --- a/src/util.c +++ b/src/util.c @@ -3017,6 +3017,21 @@ void status_welcome(void) { if (!ansi_color) const_color = "1;34"; /* Light Blue for Gentoo */ +#elif defined(TARGET_ALTLINUX) + + if (!pretty_name) { + if ((r = read_one_line_file("/etc/altlinux-release", &pretty_name)) < 0) { + + if (r != -ENOENT) + log_warning("Failed to read /etc/altlinux-release: %s", strerror(-r)); + } else + truncate_nl(pretty_name); + } + + if (!ansi_color) + const_color = "0;36"; /* Cyan for ALTLinux */ + + #elif defined(TARGET_DEBIAN) if (!pretty_name) { diff --git a/src/vconsole-setup.c b/src/vconsole-setup.c index d05c277ad9..1952dfb0f1 100644 --- a/src/vconsole-setup.c +++ b/src/vconsole-setup.c @@ -280,6 +280,24 @@ int main(int argc, char **argv) { if (r != -ENOENT) log_warning("Failed to read /etc/sysconfig/font: %s", strerror(-r)); } + +#elif defined(TARGET_ALTLINUX) + 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/consolefont", NEWLINE, + "SYSFONT", &vc_font, + NULL)) < 0) { + + if (r != -ENOENT) + log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r)); + } + #elif defined(TARGET_GENTOO) if ((r = parse_env_file("/etc/rc.conf", NEWLINE, "unicode", &vc_unicode, |