---- systemd-37/configure.ac.orig 2011-10-11 20:46:33.000000000 +0200
-+++ systemd-37/configure.ac 2011-11-26 15:07:34.443334839 +0100
-@@ -361,6 +361,7 @@
- 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)])
- else
- test -f "/etc/redhat-release" && with_distro="fedora"
-+ test -f "/etc/pld-release" && with_distro="pld"
- test -f "/etc/SuSE-release" && with_distro="suse"
- test -f "/etc/debian_version" && with_distro="debian"
- test -f "/etc/arch-release" && with_distro="arch"
-@@ -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=
-@@ -503,6 +509,7 @@
- fi
+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 =
- AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
-+AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld)
- AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
- AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
- AM_CONDITIONAL(TARGET_UBUNTU, test x"$with_distro" = xubuntu)
---- systemd-37/Makefile.am.orig 2011-10-11 20:46:33.000000000 +0200
-+++ systemd-37/Makefile.am 2011-11-26 15:07:34.443334839 +0100
-@@ -115,6 +115,12 @@
- -DKBD_SETFONT=\"/usr/bin/setfont\" \
- -DDEFAULT_FONT=\"LatArCyrHeb-16\"
- else
-+if TARGET_PLD
-+AM_CPPFLAGS += \
-+ -DKBD_LOADKEYS=\"/usr/bin/loadkeys\" \
-+ -DKBD_SETFONT=\"/bin/setfont\" \
-+ -DDEFAULT_FONT=\"LatArCyrHeb-16\"
-+else
- AM_CPPFLAGS += \
- -DKBD_LOADKEYS=\"/bin/loadkeys\" \
- -DKBD_SETFONT=\"/bin/setfont\" \
-@@ -125,6 +131,7 @@
- endif
- endif
- endif
-+endif
+ 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)
- rootbin_PROGRAMS = \
- systemd \
-@@ -1949,6 +1955,23 @@
- $(MKDIR_P) -m 0755 $(DESTDIR)$(systemunitdir)/final.target.wants
- ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
- rm -f rc-local.service && \
-+ $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
-+ ( cd $(DESTDIR)$(systemunitdir)/final.target.wants && \
-+ rm -f halt-local.service && \
-+ $(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
+ 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 )
-+ ( cd $(DESTDIR)$(systemunitdir)/graphical.target.wants && \
-+ rm -f display-manager.service && \
-+ $(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
-+endif
-+
-+if TARGET_PLD
-+ $(MKDIR_P) -m 0755 $(DESTDIR)$(systemunitdir)/final.target.wants
-+ ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
-+ rm -f rc-local.service && \
- $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
- ( cd $(DESTDIR)$(systemunitdir)/final.target.wants && \
- rm -f halt-local.service && \
-diff -ur systemd-37orig/src/fsck.c systemd-37/src/fsck.c
---- systemd-37orig/src/fsck.c 2011-09-23 17:17:15.000000000 +0200
-+++ systemd-37/src/fsck.c 2011-11-26 15:44:19.573328437 +0100
-@@ -127,7 +127,7 @@
- arg_skip = true;
- else if (startswith(w, "fsck.mode"))
- log_warning("Invalid fsck.mode= parameter. Ignoring.");
--#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_MANDRIVA)
- else if (strneq(w, "fastboot", l))
- arg_skip = true;
- else if (strneq(w, "forcefsck", l))
-diff -ur systemd-37orig/src/hostname-setup.c systemd-37/src/hostname-setup.c
---- systemd-37orig/src/hostname-setup.c 2011-11-26 13:04:04.000000000 +0100
-+++ systemd-37/src/hostname-setup.c 2011-11-26 15:48:30.890005881 +0100
-@@ -30,7 +30,7 @@
- #include "util.h"
- #include "log.h"
--#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
- #define FILENAME "/etc/sysconfig/network"
- #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
- #define FILENAME "/etc/HOSTNAME"
-@@ -64,7 +64,7 @@
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
- static int read_distro_hostname(char **hn) {
+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;
+ }
--#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
++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;
- FILE *f;
+ _cleanup_free_ char *b = NULL;
+ const char *hn;
+ bool enoent = false;
-diff -ur systemd-37orig/src/locale-setup.c systemd-37/src/locale-setup.c
---- systemd-37orig/src/locale-setup.c 2011-09-23 17:16:34.000000000 +0200
-+++ systemd-37/src/locale-setup.c 2011-11-26 15:47:40.906672674 +0100
-@@ -74,7 +74,7 @@
+- 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)
- if ((r = parse_env_file("/proc/cmdline", WHITESPACE,
--#if defined(TARGET_FEDORA) || defined(TARGET_MEEGO)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_MEEGO)
- "LANG", &variables[VARIABLE_LANG],
- #endif
- "locale.LANG", &variables[VARIABLE_LANG],
-@@ -121,7 +121,7 @@
+ 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 defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MEEGO)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_ALTLINUX) || defined(TARGET_MEEGO)
- if (r <= 0 &&
- (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
- "LANG", &variables[VARIABLE_LANG],
-diff -ur systemd-37orig/src/systemctl.c systemd-37/src/systemctl.c
---- systemd-37orig/src/systemctl.c 2011-10-11 03:17:42.000000000 +0200
-+++ systemd-37/src/systemctl.c 2011-11-26 15:42:15.089997670 +0100
-@@ -3443,7 +3443,7 @@
- static int enable_sysv_units(char **args) {
- int r = 0;
-
--#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX))
-+#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX))
- const char *verb = args[0];
- unsigned f = 1, t = 1;
- LookupPaths paths;
-diff -ur systemd-37orig/src/timedated.c systemd-37/src/timedated.c
---- systemd-37orig/src/timedated.c 2011-10-11 04:22:35.000000000 +0200
-+++ systemd-37/src/timedated.c 2011-11-26 15:44:03.823326808 +0100
-@@ -174,7 +174,7 @@
- if (r != -ENOENT)
- log_warning("Failed to read /etc/timezone: %s", strerror(-r));
-
--#ifdef TARGET_FEDORA
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD)
- r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
- "ZONE", &zone,
- NULL);
-diff -ur systemd-37orig/src/util.c systemd-37/src/util.c
---- systemd-37orig/src/util.c 2011-10-11 03:17:51.000000000 +0200
-+++ systemd-37/src/util.c 2011-11-26 15:46:57.579996731 +0100
-@@ -3599,6 +3599,19 @@
- const_color = "0;34"; /* Blue for Fedora */
- }
-
-+#elif defined(TARGET_PLD)
-+
-+ if (!pretty_name) {
-+ if ((r = read_one_line_file("/etc/pld-release", &pretty_name)) < 0) {
++ 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/pld-release: %s", strerror(-r));
-+ }
++ if (r != -ENOENT)
++ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+
-+ if (!ansi_color)
-+ const_color = "0;32"; /* Green for PLD */
-+
- #elif defined(TARGET_SUSE)
+ 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 @@
+ }
+ }
- if (!pretty_name) {
-diff -ur systemd-37orig/src/vconsole-setup.c systemd-37/src/vconsole-setup.c
---- systemd-37orig/src/vconsole-setup.c 2011-09-28 04:34:17.000000000 +0200
-+++ systemd-37/src/vconsole-setup.c 2011-11-26 15:42:54.143324363 +0100
-@@ -230,7 +230,7 @@
++ 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 (r <= 0) {
--#if defined(TARGET_FEDORA) || defined(TARGET_MEEGO)
-+#if defined(TARGET_FEDORA) || defined(TARGET_PLD) || defined(TARGET_MEEGO)
- if ((r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
- "SYSFONT", &vc_font,
- "SYSFONTACM", &vc_font_map,
-diff -ur systemd-37orig/units/console-shell.service.m4 systemd-37/units/console-shell.service.m4
---- systemd-37orig/units/console-shell.service.m4 2011-09-21 00:48:26.000000000 +0200
-+++ systemd-37/units/console-shell.service.m4 2011-11-26 15:49:15.266671820 +0100
-@@ -11,6 +11,9 @@
- m4_ifdef(`TARGET_FEDORA',
- After=rc-local.service
- )m4_dnl
-+m4_ifdef(`TARGET_PLD',
-+After=rc-local.service
-+)m4_dnl
- m4_ifdef(`TARGET_ARCH',
- After=rc-local.service
- )m4_dnl
-diff -ur systemd-37orig/units/getty@.service.m4 systemd-37/units/getty@.service.m4
---- systemd-37orig/units/getty@.service.m4 2011-08-31 14:33:29.000000000 +0200
-+++ systemd-37/units/getty@.service.m4 2011-11-26 15:49:07.480001391 +0100
-@@ -12,6 +12,9 @@
- m4_ifdef(`TARGET_FEDORA',
- After=rc-local.service
- )m4_dnl
-+m4_ifdef(`TARGET_PLD',
-+After=rc-local.service
-+)m4_dnl
- m4_ifdef(`TARGET_ARCH',
- After=rc-local.service
- )m4_dnl
-diff -ur systemd-37orig/units/rescue.service.m4 systemd-37/units/rescue.service.m4
---- systemd-37orig/units/rescue.service.m4 2011-09-23 01:45:34.000000000 +0200
-+++ systemd-37/units/rescue.service.m4 2011-11-26 15:50:48.323334353 +0100
-@@ -25,10 +25,13 @@
- m4_ifdef(`TARGET_MANDRIVA',
- `EnvironmentFile=/etc/sysconfig/init
- ExecStart=-/bin/bash -c "exec ${SINGLE}"',
-+m4_ifdef(`TARGET_PLD',
-+`EnvironmentFile=/etc/sysconfig/init
-+ExecStart=-/bin/bash -c "exec ${SINGLE}"',
- m4_ifdef(`TARGET_MEEGO',
- `EnvironmentFile=/etc/sysconfig/init
- ExecStart=-/bin/bash -c "exec ${SINGLE}"',
--`ExecStart=-/sbin/sulogin')))
-+`ExecStart=-/sbin/sulogin'))))
- ExecStopPost=-/bin/systemctl --fail --no-block default
- StandardInput=tty-force
- StandardOutput=inherit
-diff -ur systemd-37orig/units/serial-getty@.service.m4 systemd-37/units/serial-getty@.service.m4
---- systemd-37orig/units/serial-getty@.service.m4 2011-05-18 00:13:05.000000000 +0200
-+++ systemd-37/units/serial-getty@.service.m4 2011-11-26 15:48:58.076667457 +0100
-@@ -12,6 +12,9 @@
- m4_ifdef(`TARGET_FEDORA',
- After=rc-local.service
- )m4_dnl
-+m4_ifdef(`TARGET_PLD',
-+After=rc-local.service
-+)m4_dnl
- m4_ifdef(`TARGET_ARCH',
- After=rc-local.service
- )m4_dnl
+ if (utf8)
+ enable_utf8(fd);