On Sun, Jan 18, 2015 at 12:52 PM, Kay Sievers <[email protected]> wrote: > On Sun, Jan 18, 2015 at 7:53 PM, Shawn Landden <[email protected]> > wrote: > > From: Shawn Paul Landden <[email protected]> > > > > The current Debian solution to this is really ugly, and I would rather > > have them use the correct patch even if split usr is dumb. > > Please keep this local to the distro, this is no upstream material. > /etc/timezon is redundant information in a separate file. We do not > want to support this thing in systemd. > > The split /usr support is pretty much limited to locations of files, > but should not change fundamental logic or introduce new concepts or > config files. > > While I have no problem with this position as I support unified usr, realize that without this timedated does not support split usr, and systemd be clear about this in the "split-usr-is-broken" warning/essay.
> Thanks, > Kay > _______________________________________________ > systemd-devel mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/systemd-devel > -- Shawn Landden
From 0f0d2f6b3e295c8d67a689e48b23188a027ce6b3 Mon Sep 17 00:00:00 2001 From: Shawn Paul Landden <[email protected]> Date: Sun, 21 Dec 2014 23:00:01 -0800 Subject: [PATCH] timedated: support split usr v3 The current Debian solution to this is really ugly, and I would rather have them use the correct patch even if split usr is dumb. Read: http://rusty.ozlabs.org/?p=236 ("Why Everyone Must Oppose The Merging of /usr and /") (I managed to skip the pulseaudio implamentation mess because I had a fancy emu10k1 SoundBlaster Live! 5.1 which does its own hardware mixing.) Putting the reading of /etc/timezone inside #ifdef CONFIG_SPLIT_USR assumes a system with never go from NORMAL_USR to SPLIT_USR v3: revert 99f861310d3f05f4 v4: was missing a git add --- src/timedate/timedated.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 753c3d1..7f748df 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -29,6 +29,7 @@ #include "sd-bus.h" #include "util.h" +#include "copy.h" #include "strv.h" #include "def.h" #include "clock-util.h" @@ -95,6 +96,14 @@ static int context_read_data(Context *c) { } } +#ifdef HAVE_SPLIT_USR + r = read_one_line_file("/etc/timezone", &c->zone); + if (r < 0) { + if (r != -ENOENT) + log_warning("Failed to read /etc/timezone: %s", strerror(-r)); + } +#endif + have_timezone: if (isempty(c->zone)) { free(c->zone); @@ -123,9 +132,21 @@ static int context_write_data_timezone(Context *c) { if (!p) return log_oom(); +#ifdef HAVE_SPLIT_USR + r = write_string_file_atomic("/etc/timezone", c->zone); + if (r < 0) + return r; + + /* "/usr/sha..." */ + r = copy_file((p + 2), "/etc/localtime", O_TRUNC, + S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, 0); /*644*/ + if (r < 0) + return r; +#else r = symlink_atomic(p, "/etc/localtime"); if (r < 0) return r; +#endif return 0; } -- 2.1.4
_______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
