Refresh patches

This commit is contained in:
Luca Boccassi 2022-10-22 01:09:35 +01:00
parent 37755d34f0
commit dc6626fa70
10 changed files with 194 additions and 219 deletions

View File

@ -20,10 +20,10 @@ Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62344
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/libsystemd/sd-id128/sd-id128.c b/src/libsystemd/sd-id128/sd-id128.c
index 09c3401..2d4b117 100644
index 709c8ff..78e7151 100644
--- a/src/libsystemd/sd-id128/sd-id128.c
+++ b/src/libsystemd/sd-id128/sd-id128.c
@@ -108,7 +108,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
@@ -124,7 +124,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
assert_return(ret, -EINVAL);
if (sd_id128_is_null(saved_machine_id)) {

View File

@ -12,10 +12,10 @@ Forwarded: http://lists.freedesktop.org/archives/systemd-devel/2014-April/018960
1 file changed, 6 insertions(+)
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index a56f2ff..2d2aa19 100644
index efc066c..550aba0 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -476,6 +476,12 @@ static bool enough_swap_for_hibernation(void) {
@@ -963,6 +963,12 @@ static bool enough_swap_for_hibernation(void) {
if (getenv_bool("SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK") > 0)
return true;

View File

@ -16,10 +16,10 @@ Bug-Debian: https://bugs.debian.org/773528
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index ed7e428..0abed9c 100644
index 043b3ea..91ba8f0 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -426,7 +426,7 @@
@@ -434,7 +434,7 @@
<command>systemd-journald</command> collects generated audit records, it just controls whether it
tells the kernel to generate them. This means if another tool turns on auditing even if
<command>systemd-journald</command> left it off, it will still collect the generated
@ -29,10 +29,10 @@ index ed7e428..0abed9c 100644
<varlistentry>
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 3ed8b80..5d373f4 100644
index e5708c7..c36936d 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2293,7 +2293,7 @@ int server_init(Server *s, const char *namespace) {
@@ -2267,7 +2267,7 @@ int server_init(Server *s, const char *namespace) {
.compress.threshold_bytes = UINT64_MAX,
.seal = true,

View File

@ -16,10 +16,10 @@ Closes: #981407
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 8a14cd5..4d0add9 100644
index b39cb8c..b01d38b 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -522,6 +522,7 @@ static int patch_var_run(
@@ -543,6 +543,7 @@ static int patch_var_run(
const char *e;
char *z;
@ -27,7 +27,7 @@ index 8a14cd5..4d0add9 100644
e = path_startswith(*path, "/var/run/");
if (!e)
@@ -531,7 +532,8 @@ static int patch_var_run(
@@ -552,7 +553,8 @@ static int patch_var_run(
if (!z)
return log_oom();
@ -38,10 +38,10 @@ index 8a14cd5..4d0add9 100644
"please update the unit file accordingly.", lvalue, *path, z);
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 14ae873..aa9e94b 100644
index 3c5df6c..24eff86 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -760,7 +760,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
@@ -761,7 +761,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
if (!fpath)
return log_oom();
@ -51,10 +51,10 @@ index 14ae873..aa9e94b 100644
"Please update package to include a native systemd unit file, in order to make it more safe and robust.", fpath);
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 53cd570..7d71edd 100644
index 7687316..2240ff9 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -2757,6 +2757,7 @@ static int specifier_expansion_from_arg(const Specifier *specifier_table, Item *
@@ -2970,6 +2970,7 @@ static int specifier_expansion_from_arg(const Specifier *specifier_table, Item *
static int patch_var_run(const char *fname, unsigned line, char **path) {
const char *k;
char *n;
@ -62,7 +62,7 @@ index 53cd570..7d71edd 100644
assert(path);
assert(*path);
@@ -2782,7 +2783,8 @@ static int patch_var_run(const char *fname, unsigned line, char **path) {
@@ -2995,7 +2996,8 @@ static int patch_var_run(const char *fname, unsigned line, char **path) {
/* Also log about this briefly. We do so at LOG_NOTICE level, as we fixed up the situation automatically, hence
* there's no immediate need for action by the user. However, in the interest of making things less confusing
* to the user, let's still inform the user that these snippets should really be updated. */

View File

@ -17,10 +17,10 @@ conf.d snippet.
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index 4b0dd90..ed7e428 100644
index a14abad..043b3ea 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -353,7 +353,7 @@
@@ -361,7 +361,7 @@
traditional syslog daemon, to the kernel log buffer (kmsg), to the system console, or sent as wall
messages to all logged-in users. These options take boolean arguments. If forwarding to syslog is
enabled but nothing reads messages from the socket, forwarding to syslog has no effect. By default,
@ -30,10 +30,10 @@ index 4b0dd90..ed7e428 100644
<literal>systemd.journald.forward_to_kmsg</literal>,
<literal>systemd.journald.forward_to_console</literal>, and
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index dc94337..3ed8b80 100644
index 71d7a59..e5708c7 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2303,6 +2303,7 @@ int server_init(Server *s, const char *namespace) {
@@ -2277,6 +2277,7 @@ int server_init(Server *s, const char *namespace) {
.ratelimit_interval = DEFAULT_RATE_LIMIT_INTERVAL,
.ratelimit_burst = DEFAULT_RATE_LIMIT_BURST,

View File

@ -14,10 +14,10 @@ Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1141137
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 1b0c5fc..bdca10e 100644
index d0f7188..fa634ac 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -4609,16 +4609,7 @@ int unit_kill_context(
@@ -4629,16 +4629,7 @@ int unit_kill_context(
} else if (r > 0) {

View File

@ -19,10 +19,10 @@ Bug-Debian: https://bugs.debian.org/815020
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/src/core/main.c b/src/core/main.c
index 69d450a..badd385 100644
index 14a4f81..696bb28 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1619,24 +1619,6 @@ static void cmdline_take_random_seed(void) {
@@ -1648,24 +1648,6 @@ static void cmdline_take_random_seed(void) {
"This functionality should not be used outside of testing environments.");
}
@ -38,7 +38,7 @@ index 69d450a..badd385 100644
-
- /* But at the same time, turn off the core_pattern logic by default, so that no coredumps are stored
- * until the systemd-coredump tool is enabled via sysctl. However it can be changed via the kernel
- * command line later so core dumps can still be generated during early startup and in initramfs. */
- * command line later so core dumps can still be generated during early startup and in initrd. */
- if (!skip_setup)
- disable_coredumps();
-#endif
@ -47,7 +47,7 @@ index 69d450a..badd385 100644
static void initialize_core_pattern(bool skip_setup) {
int r;
@@ -2763,8 +2745,6 @@ int main(int argc, char *argv[]) {
@@ -2802,8 +2784,6 @@ int main(int argc, char *argv[]) {
kernel_timestamp = DUAL_TIMESTAMP_NULL;
}

View File

@ -15,10 +15,10 @@ Closes: #810748
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 75523d0..3590cb7 100644
index e76de45..8619dba 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -358,6 +358,7 @@ static int add_mount(
@@ -368,6 +368,7 @@ static int add_mount(
_cleanup_strv_free_ char **wanted_by = NULL, **required_by = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
@ -26,8 +26,8 @@ index 75523d0..3590cb7 100644
assert(what);
assert(where);
@@ -440,9 +441,13 @@ static int add_mount(
fprintf(f, "Before=%s\n", post);
@@ -455,9 +456,13 @@ static int add_mount(
fprintf(f, "Before=%s\n", target_unit);
if (passno != 0) {
- r = generator_write_fsck_deps(f, dest, what, where, fstype);

View File

@ -9,17 +9,17 @@ keyboard configuration.
Read/write /etc/timezone if /etc/localtime does not exist.
---
src/basic/time-util.c | 34 ++++++--
src/core/locale-setup.c | 21 +++++
src/locale/keymap-util.c | 201 ++++++++++++++++++++++-------------------------
src/timedate/timedated.c | 21 ++++-
4 files changed, 164 insertions(+), 113 deletions(-)
src/basic/time-util.c | 34 +++++++--
src/locale/localed-util.c | 188 ++++++++++++++++++++--------------------------
src/shared/locale-setup.c | 24 ++++--
src/timedate/timedated.c | 21 +++++-
4 files changed, 147 insertions(+), 120 deletions(-)
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index 0ad8de4..f0f0ef4 100644
index 71b2f67..fa00d9d 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1477,19 +1477,43 @@ int get_timezone(char **ret) {
@@ -1475,19 +1475,43 @@ int get_timezone(char **ret) {
const char *e;
char *z;
int r;
@ -68,82 +68,11 @@ index 0ad8de4..f0f0ef4 100644
e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
if (!e)
diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
index 716febb..9818602 100644
--- a/src/core/locale-setup.c
+++ b/src/core/locale-setup.c
@@ -57,6 +57,27 @@ int locale_setup(char ***environment) {
log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
}
+ if (r <= 0) {
+ r = parse_env_file(NULL, "/etc/default/locale",
+ "LANG", &variables[VARIABLE_LANG],
+ "LANGUAGE", &variables[VARIABLE_LANGUAGE],
+ "LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
+ "LC_NUMERIC", &variables[VARIABLE_LC_NUMERIC],
+ "LC_TIME", &variables[VARIABLE_LC_TIME],
+ "LC_COLLATE", &variables[VARIABLE_LC_COLLATE],
+ "LC_MONETARY", &variables[VARIABLE_LC_MONETARY],
+ "LC_MESSAGES", &variables[VARIABLE_LC_MESSAGES],
+ "LC_PAPER", &variables[VARIABLE_LC_PAPER],
+ "LC_NAME", &variables[VARIABLE_LC_NAME],
+ "LC_ADDRESS", &variables[VARIABLE_LC_ADDRESS],
+ "LC_TELEPHONE", &variables[VARIABLE_LC_TELEPHONE],
+ "LC_MEASUREMENT", &variables[VARIABLE_LC_MEASUREMENT],
+ "LC_IDENTIFICATION", &variables[VARIABLE_LC_IDENTIFICATION]);
+
+ if (r < 0 && r != -ENOENT)
+ log_warning_errno(r, "Failed to read /etc/default/locale: %m");
+ }
+
for (LocaleVariable i = 0; i < _VARIABLE_LC_MAX; i++) {
char *s;
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index 2d1b982..96b7eca 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -91,6 +91,7 @@ void locale_simplify(char *locale[_VARIABLE_LC_MAX]) {
int locale_read_data(Context *c, sd_bus_message *m) {
struct stat st;
int r;
+ const char *path = "/etc/locale.conf";
/* Do not try to re-read the file within single bus operation. */
if (m) {
@@ -101,7 +102,11 @@ int locale_read_data(Context *c, sd_bus_message *m) {
c->locale_cache = sd_bus_message_ref(m);
}
- r = stat("/etc/locale.conf", &st);
+ r = stat(path, &st);
+ if (r < 0 && errno == ENOENT) {
+ path = "/etc/default/locale";
+ r = stat(path, &st);
+ }
if (r < 0 && errno != ENOENT)
return -errno;
@@ -116,7 +121,7 @@ int locale_read_data(Context *c, sd_bus_message *m) {
c->locale_mtime = t;
context_free_locale(c);
- r = parse_env_file(NULL, "/etc/locale.conf",
+ r = parse_env_file(NULL, path,
"LANG", &c->locale[VARIABLE_LANG],
"LANGUAGE", &c->locale[VARIABLE_LANGUAGE],
"LC_CTYPE", &c->locale[VARIABLE_LC_CTYPE],
@@ -190,8 +195,6 @@ int vconsole_read_data(Context *c, sd_bus_message *m) {
}
int x11_read_data(Context *c, sd_bus_message *m) {
- _cleanup_fclose_ FILE *f = NULL;
- bool in_section = false;
struct stat st;
usec_t t;
int r;
@@ -205,7 +208,7 @@ int x11_read_data(Context *c, sd_bus_message *m) {
diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c
index dd2bbf5..4df9da6 100644
--- a/src/locale/localed-util.c
+++ b/src/locale/localed-util.c
@@ -142,7 +142,7 @@ int x11_read_data(Context *c, sd_bus_message *m) {
c->x11_cache = sd_bus_message_ref(m);
}
@ -152,19 +81,14 @@ index 2d1b982..96b7eca 100644
if (errno != ENOENT)
return -errno;
@@ -222,60 +225,14 @@ int x11_read_data(Context *c, sd_bus_message *m) {
@@ -159,60 +159,14 @@ int x11_read_data(Context *c, sd_bus_message *m) {
c->x11_mtime = t;
context_free_x11(c);
- f = fopen("/etc/X11/xorg.conf.d/00-keyboard.conf", "re");
- if (!f)
- return -errno;
+ r = parse_env_file(NULL, "/etc/default/keyboard",
+ "XKBMODEL", &c->x11_model,
+ "XKBLAYOUT", &c->x11_layout,
+ "XKBVARIANT", &c->x11_variant,
+ "XKBOPTIONS", &c->x11_options);
-
- for (;;) {
- _cleanup_free_ char *line = NULL;
- char *l;
@ -215,56 +139,18 @@ index 2d1b982..96b7eca 100644
- } else if (in_section && first_word(l, "EndSection"))
- in_section = false;
- }
+ r = parse_env_file(NULL, "/etc/default/keyboard",
+ "XKBMODEL", &c->x11_model,
+ "XKBLAYOUT", &c->x11_layout,
+ "XKBVARIANT", &c->x11_variant,
+ "XKBOPTIONS", &c->x11_options);
+
+ if (r < 0)
+ return r;
return 0;
}
@@ -284,9 +241,19 @@ int locale_write_data(Context *c, char ***settings) {
_cleanup_strv_free_ char **l = NULL;
struct stat st;
int r;
+ const char *path = "/etc/locale.conf";
+
/* Set values will be returned as strv in *settings on success. */
+ r = load_env_file(NULL, path, &l);
+ if (r < 0 && r == -ENOENT) {
+ path = "/etc/default/locale";
+ r = load_env_file(NULL, path, &l);
+ }
+ if (r < 0 && r != -ENOENT)
+ return r;
+
for (LocaleVariable p = 0; p < _VARIABLE_LC_MAX; p++)
if (!isempty(c->locale[p])) {
r = strv_env_assign(&l, locale_variable_to_string(p), c->locale[p]);
@@ -295,20 +262,20 @@ int locale_write_data(Context *c, char ***settings) {
}
if (strv_isempty(l)) {
- if (unlink("/etc/locale.conf") < 0)
+ if (unlink(path) < 0)
return errno == ENOENT ? 0 : -errno;
c->locale_mtime = USEC_INFINITY;
return 0;
}
- r = write_env_file_label("/etc/locale.conf", l);
+ r = write_env_file_label(path, l);
if (r < 0)
return r;
*settings = TAKE_PTR(l);
- if (stat("/etc/locale.conf", &st) >= 0)
+ if (stat(path, &st) >= 0)
c->locale_mtime = timespec_load(&st.st_mtim);
return 0;
@@ -350,68 +317,92 @@ int vconsole_write_data(Context *c) {
@@ -253,69 +207,93 @@ int vconsole_write_data(Context *c) {
}
int x11_write_data(Context *c) {
@ -283,7 +169,6 @@ index 2d1b982..96b7eca 100644
+ return r;
- if (unlink("/etc/X11/xorg.conf.d/00-keyboard.conf") < 0)
- return errno == ENOENT ? 0 : -errno;
+ /* This could perhaps be done more elegantly using an array
+ * like we do for the locale, instead of struct
+ */
@ -294,22 +179,14 @@ index 2d1b982..96b7eca 100644
+ strv_free(l);
+ return -ENOMEM;
+ }
- c->vc_mtime = USEC_INFINITY;
- return 0;
+
+ r = strv_env_replace_consume(&l, t);
+ if (r < 0) {
+ strv_free(l);
+ return r;
+ }
}
- (void) mkdir_p_label("/etc/X11/xorg.conf.d", 0755);
- r = fopen_temporary("/etc/X11/xorg.conf.d/00-keyboard.conf", &f, &temp_path);
- if (r < 0)
- return r;
-
- (void) fchmod(fileno(f), 0644);
+ }
+
+ if (isempty(c->x11_model)) {
+ l = strv_env_unset(l, "XKBMODEL");
+ } else {
@ -317,22 +194,14 @@ index 2d1b982..96b7eca 100644
+ strv_free(l);
+ return -ENOMEM;
+ }
- fputs("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n"
- "# probably wise not to edit this file manually. Use localectl(1) to\n"
- "# instruct systemd-localed to update it.\n"
- "Section \"InputClass\"\n"
- " Identifier \"system-keyboard\"\n"
- " MatchIsKeyboard \"on\"\n", f);
+
+ r = strv_env_replace_consume(&l, t);
+ if (r < 0) {
+ strv_free(l);
+ return r;
+ }
+ }
- if (!isempty(c->x11_layout))
- fprintf(f, " Option \"XkbLayout\" \"%s\"\n", c->x11_layout);
+
+ if (isempty(c->x11_variant)) {
+ l = strv_env_unset(l, "XKBVARIANT");
+ } else {
@ -340,18 +209,14 @@ index 2d1b982..96b7eca 100644
+ strv_free(l);
+ return -ENOMEM;
+ }
- if (!isempty(c->x11_model))
- fprintf(f, " Option \"XkbModel\" \"%s\"\n", c->x11_model);
+
+ r = strv_env_replace_consume(&l, t);
+ if (r < 0) {
+ strv_free(l);
+ return r;
+ }
+ }
- if (!isempty(c->x11_variant))
- fprintf(f, " Option \"XkbVariant\" \"%s\"\n", c->x11_variant);
+
+ if (isempty(c->x11_options)) {
+ l = strv_env_unset(l, "XKBOPTIONS");
+ } else {
@ -359,50 +224,160 @@ index 2d1b982..96b7eca 100644
+ strv_free(l);
+ return -ENOMEM;
+ }
- if (!isempty(c->x11_options))
- fprintf(f, " Option \"XkbOptions\" \"%s\"\n", c->x11_options);
+
+ r = strv_env_replace_consume(&l, t);
+ if (r < 0) {
+ strv_free(l);
+ return r;
+ }
+ }
- fputs("EndSection\n", f);
+
+ if (strv_isempty(l)) {
+ strv_free(l);
+
+ if (unlink("/etc/default/keyboard") < 0)
return errno == ENOENT ? 0 : -errno;
c->vc_mtime = USEC_INFINITY;
return 0;
}
- (void) mkdir_p_label("/etc/X11/xorg.conf.d", 0755);
- r = fopen_temporary("/etc/X11/xorg.conf.d/00-keyboard.conf", &f, &temp_path);
- if (r < 0)
- return r;
+ r = write_env_file("/etc/default/keyboard", l);
+ strv_free(l);
- (void) fchmod(fileno(f), 0644);
-
- fputs("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n"
- "# probably wise not to edit this file manually. Use localectl(1) to\n"
- "# instruct systemd-localed to update it.\n"
- "Section \"InputClass\"\n"
- " Identifier \"system-keyboard\"\n"
- " MatchIsKeyboard \"on\"\n", f);
-
- if (!isempty(c->x11_layout))
- fprintf(f, " Option \"XkbLayout\" \"%s\"\n", c->x11_layout);
-
- if (!isempty(c->x11_model))
- fprintf(f, " Option \"XkbModel\" \"%s\"\n", c->x11_model);
-
- if (!isempty(c->x11_variant))
- fprintf(f, " Option \"XkbVariant\" \"%s\"\n", c->x11_variant);
-
- if (!isempty(c->x11_options))
- fprintf(f, " Option \"XkbOptions\" \"%s\"\n", c->x11_options);
-
- fputs("EndSection\n", f);
-
- r = fflush_sync_and_check(f);
- if (r < 0)
- goto fail;
+ if (unlink("/etc/default/keyboard") < 0)
+ return errno == ENOENT ? 0 : -errno;
-
- if (rename(temp_path, "/etc/X11/xorg.conf.d/00-keyboard.conf") < 0) {
- r = -errno;
- goto fail;
+ c->vc_mtime = USEC_INFINITY;
+ return 0;
}
- }
-
- if (stat("/etc/X11/xorg.conf.d/00-keyboard.conf", &st) >= 0)
- c->x11_mtime = timespec_load(&st.st_mtim);
+ r = write_env_file("/etc/default/keyboard", l);
+ strv_free(l);
+ if (r >= 0 && stat("/etc/default/keyboard", &st) >= 0)
c->x11_mtime = timespec_load(&st.st_mtim);
- return 0;
-
-fail:
- if (temp_path)
- (void) unlink(temp_path);
+ if (r >= 0 && stat("/etc/default/keyboard", &st) >= 0)
+ c->x11_mtime = timespec_load(&st.st_mtim);
-
return r;
}
diff --git a/src/shared/locale-setup.c b/src/shared/locale-setup.c
index b8c6647..be7efcb 100644
--- a/src/shared/locale-setup.c
+++ b/src/shared/locale-setup.c
@@ -49,14 +49,20 @@ int locale_context_load(LocaleContext *c, LocaleLoadFlag flag) {
}
if (FLAGS_SET(flag, LOCALE_LOAD_LOCALE_CONF)) {
+ const char *path = "/etc/locale.conf";
struct stat st;
usec_t t;
- r = stat("/etc/locale.conf", &st);
+ r = stat(path, &st);
+ if (r < 0 && errno == ENOENT) {
+ path = "/etc/default/locale";
+ r = stat(path, &st);
+ }
if (r < 0 && errno != ENOENT)
- return log_debug_errno(errno, "Failed to stat /etc/locale.conf: %m");
+ return log_debug_errno(errno, "Failed to stat %s: %m", path);
if (r >= 0) {
+
/* If mtime is not changed, then we do not need to re-read the file. */
t = timespec_load(&st.st_mtim);
if (c->mtime != USEC_INFINITY && t == c->mtime)
@@ -65,7 +71,7 @@ int locale_context_load(LocaleContext *c, LocaleLoadFlag flag) {
locale_context_clear(c);
c->mtime = t;
- r = parse_env_file(NULL, "/etc/locale.conf",
+ r = parse_env_file(NULL, path,
"LANG", &c->locale[VARIABLE_LANG],
"LANGUAGE", &c->locale[VARIABLE_LANGUAGE],
"LC_CTYPE", &c->locale[VARIABLE_LC_CTYPE],
@@ -81,7 +87,7 @@ int locale_context_load(LocaleContext *c, LocaleLoadFlag flag) {
"LC_MEASUREMENT", &c->locale[VARIABLE_LC_MEASUREMENT],
"LC_IDENTIFICATION", &c->locale[VARIABLE_LC_IDENTIFICATION]);
if (r < 0)
- return log_debug_errno(r, "Failed to read /etc/locale.conf: %m");
+ return log_debug_errno(r, "Failed to read %s: %m", path);
goto finalize;
}
@@ -149,17 +155,21 @@ int locale_context_save(LocaleContext *c, char ***ret_set, char ***ret_unset) {
_cleanup_strv_free_ char **set = NULL, **unset = NULL;
struct stat st;
int r;
+ const char *path = "/etc/locale.conf";
assert(c);
/* Set values will be returned as strv in *ret on success. */
+ if (access(path, F_OK) < 0 && errno == ENOENT)
+ path = "/etc/default/locale";
+
r = locale_context_build_env(c, &set, ret_unset ? &unset : NULL);
if (r < 0)
return r;
if (strv_isempty(set)) {
- if (unlink("/etc/locale.conf") < 0)
+ if (unlink(path) < 0)
return errno == ENOENT ? 0 : -errno;
c->mtime = USEC_INFINITY;
@@ -170,11 +180,11 @@ int locale_context_save(LocaleContext *c, char ***ret_set, char ***ret_unset) {
return 0;
}
- r = write_env_file_label("/etc/locale.conf", set);
+ r = write_env_file_label(path, set);
if (r < 0)
return r;
- if (stat("/etc/locale.conf", &st) >= 0)
+ if (stat(path, &st) >= 0)
c->mtime = timespec_load(&st.st_mtim);
if (ret_set)
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 9ca5d37..7b09a4c 100644
index 373574c..bc84f3b 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -296,6 +296,8 @@ static int context_read_data(Context *c) {

View File

@ -59,10 +59,10 @@ http://lists.freedesktop.org/archives/systemd-devel/2015-April/030175.html
create mode 100644 units/systemd-fsckd.socket
diff --git a/man/rules/meson.build b/man/rules/meson.build
index 55376c0..4e91263 100644
index bb77990..8609433 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -884,6 +884,7 @@ manpages = [
@@ -892,6 +892,7 @@ manpages = [
'8',
['systemd-fsck', 'systemd-fsck-root.service'],
''],
@ -239,10 +239,10 @@ index 0000000..b7ad58d
+
+</refentry>
diff --git a/meson.build b/meson.build
index 98f00f4..c63fe25 100644
index dfe18f7..8320eeb 100644
--- a/meson.build
+++ b/meson.build
@@ -3231,6 +3231,15 @@ executable(
@@ -3340,6 +3340,15 @@ executable(
install : true,
install_dir : rootlibexecdir)
@ -971,10 +971,10 @@ index 0000000..8a85b69
+ return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+}
diff --git a/units/meson.build b/units/meson.build
index e8f81f2..81bb9a8 100644
index 25e9209..8d3bef3 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -114,6 +114,7 @@ units = [
@@ -113,6 +113,7 @@ units = [
['systemd-exit.service', ''],
['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
'sysinit.target.wants/'],
@ -1004,7 +1004,7 @@ index 8378df8..4b1cd43 100644
OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly
diff --git a/units/systemd-fsck@.service.in b/units/systemd-fsck@.service.in
index 06b91aea..de0b767 100644
index 06b91ae..de0b767 100644
--- a/units/systemd-fsck@.service.in
+++ b/units/systemd-fsck@.service.in
@@ -13,7 +13,8 @@ Documentation=man:systemd-fsck@.service(8)