]> git.pld-linux.org Git - packages/systemd.git/blobdiff - target-pld.patch
up to 254.13
[packages/systemd.git] / target-pld.patch
index ed561225478de5834b6fa44119ab3324aac20a5c..6c0962ca01672e2285b842eab98e2cf01e1ab96c 100644 (file)
-diff -dur -x '*~' -x '*.orig' systemd-208.orig/Makefile.am systemd-208/Makefile.am
---- systemd-208.orig/Makefile.am       2013-10-02 04:57:09.000000000 +0200
-+++ systemd-208/Makefile.am    2014-01-09 15:15:41.000000000 +0100
-@@ -211,6 +211,8 @@
- TIMERS_TARGET_WANTS =
- USER_SOCKETS_TARGET_WANTS =
- USER_BUSNAMES_TARGET_WANTS =
-+FINAL_TARGET_WANTS =
-+GRAPHICAL_TARGET_WANTS =
+; rest of target-pld.patch logic in systemd.spec
+--- systemd-stable-248/src/shared/hostname-setup.h.orig        2021-03-30 22:59:02.000000000 +0200
++++ systemd-stable-248/src/shared/hostname-setup.h     2021-04-07 00:02:26.813489363 +0200
+@@ -18,6 +18,7 @@
  
- SYSTEM_UNIT_ALIASES =
- USER_UNIT_ALIASES =
-@@ -230,6 +232,8 @@
-       what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
-       what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
-       what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
-+      what="$(FINAL_TARGET_WANTS)" && wants=final.target && dir=$(systemunitdir) && $(add-wants)
-+      what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
+ int shorten_overlong(const char *s, char **ret);
  
- define add-wants
-       [ -z "$$what" ] || ( \
-@@ -4001,8 +4005,15 @@
-       $(systemdstatedir)
++int read_etc_hostname_distro(const char *path, char **ret);
+ int read_etc_hostname_stream(FILE *f, char **ret);
+ int read_etc_hostname(const char *path, char **ret);
  
- MULTI_USER_TARGET_WANTS += \
-+      rc-local.service \
-       systemd-logind.service
-+FINAL_TARGET_WANTS += \
-+      halt-local.service
-+
-+GRAPHICAL_TARGET_WANTS += \
-+      display-manager.service
-+
- SYSTEM_UNIT_ALIASES += \
-       systemd-logind.service dbus-org.freedesktop.login1.service
-@@ -4493,6 +4504,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 -dur -x '*~' -x '*.orig' systemd-208.orig/src/core/hostname-setup.c systemd-208/src/core/hostname-setup.c
---- systemd-208.orig/src/core/hostname-setup.c 2013-08-13 22:02:46.000000000 +0200
-+++ systemd-208/src/core/hostname-setup.c      2014-01-09 15:15:41.000000000 +0100
-@@ -23,6 +23,7 @@
+--- systemd-stable-248/src/shared/hostname-setup.c.orig        2021-03-30 22:59:02.000000000 +0200
++++ systemd-stable-248/src/shared/hostname-setup.c     2021-04-07 00:04:58.955649812 +0200
+@@ -7,6 +7,7 @@
+ #include <unistd.h>
  
  #include "alloc-util.h"
++#include "env-file.h"
+ #include "fd-util.h"
  #include "fileio.h"
-+#include "fd-util.h"
- #include "hostname-setup.h"
- #include "hostname-util.h"
- #include "log.h"
-@@ -53,13 +53,84 @@
-         return 0;
+ #include "fs-util.h"
+@@ -130,13 +131,34 @@
+         }
  }
  
-+static int read_distro_hostname(char **hn) {
++int read_etc_hostname_distro(const char *path, char **ret) {
 +        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;
++        char *p = NULL;
++        r = parse_env_file(NULL, "/etc/sysconfig/network", "HOSTNAME", &p);
++        if (r < 0)
++                return r;
++        if (!p) /* EOF without any hostname? the file is empty, let's treat that exactly like no file at all: ENOENT */
++                return -ENOENT;
++        hostname_cleanup(p);
++         if (!hostname_is_valid(p, true))
++                 return -EBADMSG;
++         *ret = p;
++         return 0;
 +}
 +
-+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_hostname_config("/etc/hostname", hn);
-+        if (r < 0) {
-+                if (r == -ENOENT)
-+                        return read_distro_hostname(hn);
-+
-+                return r;
+ int read_etc_hostname(const char *path, char **ret) {
+         _cleanup_fclose_ FILE *f = NULL;
+         assert(ret);
+-        if (!path)
++        if (!path) {
++                int r;
+                 path = "/etc/hostname";
++                r = read_etc_hostname_distro(path, ret);
++                if (r == 0)
++                        return r;
 +        }
-+
-+        return 0;
-+}
-+
- int hostname_setup(void) {
-         int r;
-         _cleanup_free_ char *b = NULL;
-         const char *hn;
-         bool enoent = false;
  
--        r = read_hostname_config("/etc/hostname", &b);
-+        r = read_hostname(&b);
-         if (r < 0) {
-                 if (r == -ENOENT)
-                         enoent = true;
-diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/core/locale-setup.c systemd-208/src/core/locale-setup.c
---- systemd-208.orig/src/core/locale-setup.c   2013-10-01 00:17:21.000000000 +0200
-+++ systemd-208/src/core/locale-setup.c        2014-01-09 15:15:41.000000000 +0100
-@@ -76,6 +76,7 @@
+         f = fopen(path, "re");
+         if (!f)
+--- systemd-240/src/shared/locale-setup.c.orig 2019-01-13 09:27:36.718995151 +0100
++++ systemd-240/src/shared/locale-setup.c      2019-01-13 09:29:37.548993771 +0100
+@@ -21,6 +21,7 @@
+         locale_context_clear(c);
  
-         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],
-@@ -120,6 +121,15 @@
-                         log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
-         }
+         r = proc_cmdline_get_key_many(PROC_CMDLINE_STRIP_RD_PREFIX,
++                                      "LANG",                     &c->locale[VARIABLE_LANG],
+                                       "locale.LANG",              &c->locale[VARIABLE_LANG],
+                                       "locale.LANGUAGE",          &c->locale[VARIABLE_LANGUAGE],
+                                       "locale.LC_CTYPE",          &c->locale[VARIABLE_LC_CTYPE],
+@@ -59,6 +60,17 @@
+         if (fstat(fd, &st) < 0)
+                 return log_debug_errno(errno, "Failed to stat /etc/locale.conf: %m");
  
-+        if (r <= 0 &&
-+            (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
-+                                "LANG", &variables[VARIABLE_LANG],
-+                                NULL)) < 0) {
++        if (r < 0 && stat("/etc/sysconfig/i18n", &st) == 0) {
++                locale_context_clear(c);
++                if ((r = parse_env_file(NULL, "/etc/sysconfig/i18n",
++                                "LANG", &c->locale[VARIABLE_LANG]
++                                )) < 0) {
 +
-+                if (r != -ENOENT)
-+                        log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
++                        if (r != -ENOENT)
++                                log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
++                }
 +        }
 +
-         add = NULL;
-         for (i = 0; i < _VARIABLE_MAX; i++) {
-                 char *s;
---- a/src/basic/time-util.c~   2016-11-03 18:16:42.000000000 +0100
-+++ b/src/basic/time-util.c    2016-11-12 19:54:28.457197174 +0100
-@@ -1290,8 +1290,16 @@ int get_timezone(char **tz) {
-         e = path_startswith(t, "/usr/share/zoneinfo/");
-         if (!e)
-                 e = path_startswith(t, "../usr/share/zoneinfo/");
+         /* If the file is not changed, then we do not need to re-read the file. */
+         if (stat_inode_unmodified(&c->st, &st))
+                 return 0;
+--- systemd-240/src/basic/time-util.c.orig     2019-01-13 09:27:36.718995151 +0100
++++ systemd-240/src/basic/time-util.c  2019-01-13 09:31:12.275659356 +0100
+@@ -14,6 +14,7 @@
+ #include <unistd.h>
+ #include "alloc-util.h"
++#include "env-file.h"
+ #include "fd-util.h"
+ #include "fileio.h"
+ #include "fs-util.h"
+@@ -1385,8 +1385,16 @@
+                 return r; /* returns EINVAL if not a symlink */
+         e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
 -        if (!e)
 -                return -EINVAL;
 +        if (!e) {
-+                r = parse_env_file("/etc/sysconfig/timezone", NEWLINE,
-+                        "TIMEZONE", &e,
-+                        NULL);
++                r = parse_env_file(NULL, "/etc/sysconfig/timezone"
++                        "TIMEZONE", &e
++                        );
 +                if (r < 0) {
 +                        if (r != -ENOENT)
-+                                log_warning("Failed to read /etc/sysconfig/timezone: %s", strerror(-r));
++                                log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
 +                        return -EINVAL;
 +                }
-+        }
++      }
  
-         if (!timezone_is_valid(e))
+         if (!timezone_is_valid(e, LOG_DEBUG))
                  return -EINVAL;
-diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/vconsole/vconsole-setup.c systemd-208/src/vconsole/vconsole-setup.c
---- systemd-208.orig/src/vconsole/vconsole-setup.c     2013-08-13 22:02:47.000000000 +0200
-+++ systemd-208/src/vconsole/vconsole-setup.c  2014-01-09 15:17:49.000000000 +0100
-@@ -284,6 +284,17 @@ int main(int argc, char **argv) {
-         if (r < 0 && r != -ENOENT)
-                 log_warning("Failed to read /etc/vconsole.conf: %s", strerror(-r));
-+        if (r <= 0) {
-+                int r1 = parse_env_file("/etc/sysconfig/console", NEWLINE,
-+                                "CONSOLEFONT", &vc_font,
-+                                "CONSOLEMAP", &vc_font_map,
-+                                "CONSOLESCREENFONTMAP", &vc_font_unimap,
-+                                "KEYTABLE", &vc_keymap,
-+                                NULL);
-+                if (r1 < 0 && r1 != -ENOENT)
-+                        log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r1));
-+        } 
+--- systemd-stable-254/src/vconsole/vconsole-setup.c.orig      2023-08-02 23:51:41.833676408 +0200
++++ systemd-stable-254/src/vconsole/vconsole-setup.c   2023-08-03 00:00:16.025707038 +0200
+@@ -141,7 +141,19 @@
+         if (r < 0) {
+                 if (r != -ENOENT)
+                         log_warning_errno(r, "Failed to read /etc/vconsole.conf, ignoring: %m");
+-                return r;
++
++                int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
++                                "CONSOLEFONT", &v.config[VC_FONT],
++                                "CONSOLEMAP", &v.config[VC_FONT_MAP],
++                                "CONSOLESCREENFONTMAP", &v.config[VC_FONT_UNIMAP],
++                                "KEYTABLE", &v.config[VC_KEYMAP]
++                                );
++                if (r1 < 0) {
++                        if (r1 != -ENOENT)
++                                log_warning_errno(r1, "Failed to read /etc/sysconfig/console, ignoring: %m");
++                        return r1;
++                }
 +
-         /* Let the kernel command line override /etc/vconsole.conf */
-         if (detect_container(NULL) <= 0) {
-                 r = parse_env_file("/proc/cmdline", WHITESPACE,
+         }
+         context_merge_config(c, &v, NULL);
This page took 0.069469 seconds and 4 git commands to generate.