]> git.pld-linux.org Git - packages/systemd.git/blobdiff - target-pld.patch
- don't hardcode systemctl path in servce files
[packages/systemd.git] / target-pld.patch
index 7860322ce55a603a3c9bfa678d61685030a14bd0..b766050ef0066288ba18ba945a7e44f3edee907b 100644 (file)
---- systemd-26/configure.ac.orig       2011-05-02 14:05:34.544253875 +0200
-+++ systemd-26/configure.ac    2011-05-02 14:22:04.085559738 +0200
-@@ -369,6 +369,12 @@ case $with_distro in
-                 M4_DISTRO_FLAG=-DTARGET_MANDRIVA=1
-               have_plymouth=true
-                 ;;
-+        pld)
-+              SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
-+              SYSTEM_SYSVRCND_PATH=/etc/rc.d
-+              AC_DEFINE(TARGET_PLD, [], [Target is PLD Linux])
-+              M4_DISTRO_FLAG=-DTARGET_PLD=1
-+              ;;
-         meego)
-                 SYSTEM_SYSVINIT_PATH=
-                 SYSTEM_SYSVRCND_PATH=
+diff --git a/Makefile.am b/Makefile.am
+index 170465a..bce467d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -196,6 +196,8 @@
+ SYSINIT_TARGET_WANTS =
+ BASIC_TARGET_WANTS =
+ SOCKETS_TARGET_WANTS =
++FINAL_TARGET_WANTS =
++GRAPHICAL_TARGET_WANTS =
+ SYSTEM_UNIT_ALIASES =
+ USER_UNIT_ALIASES =
+@@ -214,6 +216,8 @@
+       what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
+       what="$(BASIC_TARGET_WANTS)" && wants=basic.target && $(add-wants)
+       what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
++      what="$(FINAL_TARGET_WANTS)" && wants=final.target && $(add-wants)
++      what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && $(add-wants)
+ define add-wants
+       [ -z "$$what" ] || ( \
+@@ -3388,9 +3392,16 @@
+       $(systemdstatedir)
+ MULTI_USER_TARGET_WANTS += \
++      rc-local.service \
+       systemd-logind.service \
+       systemd-user-sessions.service
++FINAL_TARGET_WANTS += \
++      halt-local.service
++
++GRAPHICAL_TARGET_WANTS += \
++      display-manager.service
++
+ SYSTEM_UNIT_ALIASES += \
+       systemd-logind.service dbus-org.freedesktop.login1.service
+@@ -3790,6 +3801,10 @@
+ uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
+ install-data-hook: $(INSTALL_DATA_HOOKS)
++      ( cd $(DESTDIR)$(systemunitdir) && \
++              rm -f display-manager.service single.service && \
++              $(LN_S) prefdm.service display-manager.service && \
++              $(LN_S) rescue.service single.service )
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
+index 2c2f10c..754f0c7 100644
+--- a/src/core/hostname-setup.c
++++ b/src/core/hostname-setup.c
+@@ -64,13 +64,84 @@ static int read_and_strip_hostname(const char *path, char **hn) {
+         return 0;
+ }
++static int read_distro_hostname(char **hn) {
++        int r;
++        _cleanup_fclose_ FILE *f = NULL;
++
++        assert(hn);
++
++        f = fopen("/etc/sysconfig/network", "re");
++        if (!f)
++                return -errno;
++
++        for (;;) {
++                char line[LINE_MAX];
++                char *s, *k;
++
++                if (!fgets(line, sizeof(line), f)) {
++                        if (feof(f))
++                                break;
++
++                        r = -errno;
++                        goto finish;
++                }
++
++                s = strstrip(line);
++
++                if (!startswith_no_case(s, "HOSTNAME="))
++                        continue;
++
++                k = strdup(s+9);
++                if (!k) {
++                        r = -ENOMEM;
++                        goto finish;
++                }
++
++                hostname_cleanup(k);
++
++                if (isempty(k)) {
++                        free(k);
++                        r = -ENOENT;
++                        goto finish;
++                }
++
++                *hn = k;
++                r = 0;
++                goto finish;
++        }
++
++        r = -ENOENT;
++
++finish:
++        return r;
++}
++
++static int read_hostname(char **hn) {
++        int r;
++
++        assert(hn);
++
++        /* First, try to load the generic hostname configuration file,
++         * that we support on all distributions */
++
++        r = read_and_strip_hostname("/etc/hostname", hn);
++        if (r < 0) {
++                if (r == -ENOENT)
++                        return read_distro_hostname(hn);
++
++                return r;
++        }
++
++        return 0;
++}
++
+ int hostname_setup(void) {
+         int r;
+         _cleanup_free_ char *b = NULL;
+         const char *hn;
+         bool enoent = false;
+-        r = read_and_strip_hostname("/etc/hostname", &b);
++        r = read_hostname(&b);
+         if (r < 0) {
+                 if (r == -ENOENT)
+                         enoent = true;
+diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
+index 7f692e9..0a45854 100644
+--- a/src/core/locale-setup.c
++++ b/src/core/locale-setup.c
+@@ -74,6 +74,7 @@ int locale_setup(void) {
+         if (detect_container(NULL) <= 0) {
+                 r = parse_env_file("/proc/cmdline", WHITESPACE,
++                                   "LANG",                     &variables[VARIABLE_LANG],
+                                    "locale.LANG",              &variables[VARIABLE_LANG],
+                                    "locale.LANGUAGE",          &variables[VARIABLE_LANGUAGE],
+                                    "locale.LC_CTYPE",          &variables[VARIABLE_LC_CTYPE],
+@@ -121,6 +121,15 @@ int locale_setup(void) {
+                         log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
+         }
++        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));
++        }
++
+         if (!variables[VARIABLE_LANG]) {
+                 variables[VARIABLE_LANG] = strdup("C");
+                 if (!variables[VARIABLE_LANG]) {
+--- systemd-196/src/timedate/timedated.c~      2012-10-16 23:35:40.589269718 +0200
++++ systemd-196/src/timedate/timedated.c       2012-12-21 11:46:13.545086335 +0100
+@@ -175,6 +175,13 @@
+                 }
+         }
++      r = parse_env_file("/etc/sysconfig/timezone", NEWLINE,
++                         "TIMEZONE", &tz.zone,
++                         NULL);
++      if (r < 0) {
++              if (r != -ENOENT)
++                      log_warning("Failed to read /etc/sysconfig/timezone: %s", strerror(-r));
++      }
+ have_timezone:
+         if (isempty(tz.zone)) {
+                 free(tz.zone);
+diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
+index 9196789..1d1a916 100644
+--- a/src/vconsole/vconsole-setup.c
++++ b/src/vconsole/vconsole-setup.c
+@@ -358,6 +358,17 @@
+                 if (r < 0 && r != -ENOENT)
+                         log_warning("Failed to read /etc/vconsole.conf: %s", strerror(-r));
+         }
++
++        if (r <= 0) {
++                r = parse_env_file("/etc/sysconfig/console", NEWLINE,
++                                   "CONSOLEFONT", &vc_font,
++                                   "CONSOLEMAP", &vc_font_map,
++                                   "CONSOLESCREENFONTMAP", &vc_font_unimap,
++                                   "KEYTABLE", &vc_keymap,
++                                   NULL);
++                if (r < 0 && r != -ENOENT)
++                        log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
++        }
+         if (utf8)
+                 enable_utf8(fd);
This page took 0.080329 seconds and 4 git commands to generate.