[systemd-commits] 2 commits - configure.ac src/hostname-setup.c src/locale-setup.c src/util.c src/vconsole-setup.c units/graphical.target.m4 units/multi-user.target.m4

Lennart Poettering lennart at kemper.freedesktop.org
Tue Feb 8 03:56:32 PST 2011


 configure.ac               |   10 +++++++++-
 src/hostname-setup.c       |    4 ++--
 src/locale-setup.c         |    2 +-
 src/util.c                 |   15 +++++++++++++++
 src/vconsole-setup.c       |   18 ++++++++++++++++++
 units/graphical.target.m4  |    3 +++
 units/multi-user.target.m4 |    3 +++
 7 files changed, 51 insertions(+), 4 deletions(-)

New commits:
commit 022ef2064f4b1bf0222341c6912680e52a4ec10d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Feb 8 12:54:06 2011 +0100

    locale: unify some code between fedora and altlinux

diff --git a/src/locale-setup.c b/src/locale-setup.c
index 9ac68d2..2360cea 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -115,7 +115,7 @@ int locale_setup(void) {
                         log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
         }
 
-#ifdef TARGET_FEDORA
+#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX)
         if (r <= 0 &&
             (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
                                 "LANG", &variables[VARIABLE_LANG],
@@ -155,16 +155,6 @@ 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

commit a338bab5d0603a179befce062bc6fc8a6521a232
Author: Alexey Shabalin <a.shabalin at gmail.com>
Date:   Tue Feb 8 12:50:56 2011 +0100

    build-sys: initial support ALTLinux
    
    Hi all!
    I added basic support for ALTLinux.
    Please see patch or
    http://git.altlinux.org/people/shaba/packages/systemd.git?p=systemd.git;a=shortlog;h=refs/heads/altlinux
    Thanks.

diff --git a/configure.ac b/configure.ac
index c34305c..1363b86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -269,7 +269,7 @@ AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
 
 AC_PATH_PROG([M4], [m4])
 
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware or other]))
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux or other]))
 if test "z$with_distro" = "z"; then
         if test "$cross_compiling" = yes; then
                 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
@@ -281,6 +281,7 @@ if test "z$with_distro" = "z"; then
                 test -f "/etc/gentoo-release" && with_distro="gentoo"
                 test -f "/etc/slackware-version" && with_distro="slackware"
                 test -f "/etc/frugalware-release" && with_distro="frugalware"
+                test -f "/etc/altlinux-release" && with_distro="altlinux"
                 if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
                         with_distro="ubuntu"
                 fi
@@ -362,6 +363,12 @@ case $with_distro in
                 AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
                 M4_DISTRO_FLAG=-DTARGET_FRUGALWARE=1
                 ;;
+        altlinux)
+                SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
+                SYSTEM_SYSVRCND_PATH=/etc/rc.d
+                AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
+                M4_DISTRO_FLAG=-DTARGET_ALTLINUX=1
+                ;;
         other)
                 AS_IF([test "x$with_syslog_service" = "x"],
                         [AC_MSG_ERROR([With --distro=other, you must pass --with-syslog-service= to configure])])
@@ -418,6 +425,7 @@ AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
 AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
+AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
 
 AC_DEFINE_UNQUOTED(SPECIAL_SYSLOG_SERVICE, ["$SPECIAL_SYSLOG_SERVICE"], [Syslog service name])
 
diff --git a/src/hostname-setup.c b/src/hostname-setup.c
index 0428a64..8b0ff79 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 086647b..9ac68d2 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 ef37d05..7692a2d 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 d05c277..1952dfb 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,
diff --git a/units/graphical.target.m4 b/units/graphical.target.m4
index 97c01ce..e2750c8 100644
--- a/units/graphical.target.m4
+++ b/units/graphical.target.m4
@@ -20,6 +20,9 @@ Names=runlevel5.target
 m4_ifdef(`TARGET_SUSE',
 Names=runlevel5.target
 )m4_dnl
+m4_ifdef(`TARGET_ALTLINUX',
+Names=runlevel5.target
+)m4_dnl
 AllowIsolate=yes
 
 [Install]
diff --git a/units/multi-user.target.m4 b/units/multi-user.target.m4
index 8d458c7..9df0142 100644
--- a/units/multi-user.target.m4
+++ b/units/multi-user.target.m4
@@ -20,6 +20,9 @@ Names=runlevel3.target
 m4_ifdef(`TARGET_SUSE',
 Names=runlevel3.target
 )m4_dnl
+m4_ifdef(`TARGET_ALTLINUX',
+Names=runlevel3.target
+)m4_dnl
 m4_ifdef(`TARGET_DEBIAN',
 m4_ifdef(`TARGET_UBUNTU',
 m4_dnl On Debian/Ubuntu Runlevel 2, 3, 4 and 5 are multi-user



More information about the systemd-commits mailing list