systemd: 243.7 -> 244.3

This required some changes in how we treat DEFAULT_PATH_NORMAL.
wip/yesman
Florian Klink 4 years ago
parent b4cbcba5b1
commit 9de0ac3770
  1. 8
      pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch
  2. 16
      pkgs/os-specific/linux/systemd/0003-Don-t-try-to-unmount-nix-or-nix-store.patch
  3. 44
      pkgs/os-specific/linux/systemd/0012-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
  4. 8
      pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch
  5. 41
      pkgs/os-specific/linux/systemd/0020-reintroduce-the-no-such-path-PATH-that-was-dropped-s.patch
  6. 33
      pkgs/os-specific/linux/systemd/0025-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
  7. 13
      pkgs/os-specific/linux/systemd/default.nix

@ -9,13 +9,13 @@ makes more sense to me: the device is ready; it's the filesystem
that's not, but taking care of that is the responsibility of the mount
unit. (However, this ignores the fsck unit, so it's not perfect...)
---
rules/99-systemd.rules.in | 4 ----
rules.d/99-systemd.rules.in | 4 ----
1 file changed, 4 deletions(-)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in
index c34b606216..3ab8c1c3fe 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
--- a/rules.d/99-systemd.rules.in
+++ b/rules.d/99-systemd.rules.in
@@ -17,10 +17,6 @@ SUBSYSTEM=="ubi", TAG+="systemd"
SUBSYSTEM=="block", TAG+="systemd"
SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"

@ -12,20 +12,18 @@ https://github.com/NixOS/nixos/issues/126
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index eef362f0c8..600393ffc1 100644
index a0dfa6a1a7..4ca6adcdc6 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -409,7 +409,9 @@ static bool mount_is_extrinsic(Mount *m) {
@@ -414,6 +414,8 @@ static bool mount_is_extrinsic(Mount *m) {
if (PATH_IN_SET(m->where, /* Don't bother with the OS data itself */
"/",
- "/usr"))
+ "/usr",
+ "/nix/",
+ "/nix/store"))
"/", /* (strictly speaking redundant: should already be covered by the perpetual flag check above) */
+ "/nix",
+ "/nix/store",
"/usr",
"/etc"))
return true;
if (PATH_STARTSWITH_SET(m->where,
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 2d07d3d6c1..8b112f464e 100644
--- a/src/shutdown/umount.c

@ -1,15 +1,16 @@
From 76f3fba3031d74647855ce0da2d4e317016cb7d6 Mon Sep 17 00:00:00 2001
From 78479b75c9f9342646223b3db6b4b0744817dc24 Mon Sep 17 00:00:00 2001
From: Nikolay Amiantov <ab@fmap.me>
Date: Tue, 11 Oct 2016 13:12:08 +0300
Subject: [PATCH 12/27] Change /usr/share/zoneinfo to /etc/zoneinfo
Subject: [PATCH] Change /usr/share/zoneinfo to /etc/zoneinfo
NixOS uses this path.
---
man/localtime.xml | 4 ++--
src/basic/time-util.c | 6 +++---
src/firstboot/firstboot.c | 2 +-
src/nspawn/nspawn.c | 4 ++--
src/timedate/timedated.c | 8 ++++----
4 files changed, 10 insertions(+), 10 deletions(-)
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/man/localtime.xml b/man/localtime.xml
index 0f1652ee2e..71c4f95c2e 100644
@ -34,10 +35,10 @@ index 0f1652ee2e..71c4f95c2e 100644
<literal>Etc/UTC</literal>. The resulting link should lead to the
corresponding binary
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index e14ae8f2f7..a8a3488be1 100644
index 105584e2e7..5238f69931 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1215,7 +1215,7 @@ int get_timezones(char ***ret) {
@@ -1217,7 +1217,7 @@ int get_timezones(char ***ret) {
n_allocated = 2;
n_zones = 1;
@ -46,7 +47,7 @@ index e14ae8f2f7..a8a3488be1 100644
if (f) {
for (;;) {
_cleanup_free_ char *line = NULL;
@@ -1310,7 +1310,7 @@ bool timezone_is_valid(const char *name, int log_level) {
@@ -1312,7 +1312,7 @@ bool timezone_is_valid(const char *name, int log_level) {
if (p - name >= PATH_MAX)
return false;
@ -55,7 +56,7 @@ index e14ae8f2f7..a8a3488be1 100644
fd = open(t, O_RDONLY|O_CLOEXEC);
if (fd < 0) {
@@ -1408,7 +1408,7 @@ int get_timezone(char **ret) {
@@ -1410,7 +1410,7 @@ int get_timezone(char **ret) {
if (r < 0)
return r; /* returns EINVAL if not a symlink */
@ -77,11 +78,26 @@ index 528e6452cf..c712ca9072 100644
(void) mkdir_parents(etc_localtime, 0755);
if (symlink(e, etc_localtime) < 0)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 873a76596f..a024b10f32 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1642,8 +1642,8 @@ static int userns_mkdir(const char *root, const char *path, mode_t mode, uid_t u
static const char *timezone_from_path(const char *path) {
return PATH_STARTSWITH_SET(
path,
- "../usr/share/zoneinfo/",
- "/usr/share/zoneinfo/");
+ "../etc/zoneinfo/",
+ "/etc/zoneinfo/");
}
static bool etc_writable(void) {
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index fa20d22cde..8e6dbe1efb 100644
index 5e2fb50d83..02eb2ca11d 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -265,7 +265,7 @@ static int context_read_data(Context *c) {
@@ -264,7 +264,7 @@ static int context_read_data(Context *c) {
r = get_timezone(&t);
if (r == -EINVAL)
@ -90,7 +106,7 @@ index fa20d22cde..8e6dbe1efb 100644
else if (r < 0)
log_warning_errno(r, "Failed to get target of /etc/localtime: %m");
@@ -289,7 +289,7 @@ static int context_write_data_timezone(Context *c) {
@@ -288,7 +288,7 @@ static int context_write_data_timezone(Context *c) {
if (isempty(c->zone) || streq(c->zone, "UTC")) {
@ -99,18 +115,18 @@ index fa20d22cde..8e6dbe1efb 100644
if (unlink("/etc/localtime") < 0 && errno != ENOENT)
return -errno;
@@ -297,9 +297,9 @@ static int context_write_data_timezone(Context *c) {
@@ -296,9 +296,9 @@ static int context_write_data_timezone(Context *c) {
return 0;
}
- source = "../usr/share/zoneinfo/UTC";
+ source = "zoneinfo/UTC";
+ source = "../etc/zoneinfo/UTC";
} else {
- p = path_join("../usr/share/zoneinfo", c->zone);
+ p = path_join("zoneinfo", c->zone);
+ p = path_join("../etc/zoneinfo", c->zone);
if (!p)
return -ENOMEM;
--
2.24.1
2.25.1

@ -11,7 +11,7 @@ this commit introduces two new configuration variables `factoryconfdir`
and `factorypkgconfdir` to install systemd's own configuration into nix
store again, while having executables looking up files in /etc.
---
hwdb/meson.build | 2 +-
hwdb.d/meson.build | 2 +-
meson.build | 11 +++++++----
network/meson.build | 2 +-
src/core/meson.build | 10 +++++-----
@ -30,10 +30,10 @@ store again, while having executables looking up files in /etc.
units/meson.build | 3 ++-
17 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/hwdb/meson.build b/hwdb/meson.build
diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build
index badf39f555..8fd9c7639f 100644
--- a/hwdb/meson.build
+++ b/hwdb/meson.build
--- a/hwdb.d/meson.build
+++ b/hwdb.d/meson.build
@@ -26,7 +26,7 @@ if conf.get('ENABLE_HWDB') == 1
install_dir : udevhwdbdir)

@ -1,41 +0,0 @@
From 95c4e1ffd2249a52ca02e4fbe46aa4e51c5abd17 Mon Sep 17 00:00:00 2001
From: Andreas Rammhold <andreas@rammhold.de>
Date: Fri, 2 Nov 2018 20:56:49 +0100
Subject: [PATCH 20/27] reintroduce the /no-such-path PATH that was dropped
some versions ago
Originally eelco set the DEFAULT_PATH_NORMAL to "/no-such-path" since we
do not need that in NixOS and usually refer to all our executables with
an absolute path. This commit reintroduces this change.
---
src/basic/path-util.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 71fb7041a3..b856e782a8 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -28,13 +28,13 @@
# define PATH_SBIN_BIN_NULSTR(x) PATH_NORMAL_SBIN_BIN_NULSTR(x)
#endif
-#define DEFAULT_PATH_NORMAL PATH_SBIN_BIN("/usr/local/") ":" PATH_SBIN_BIN("/usr/")
-#define DEFAULT_USER_PATH_NORMAL PATH_BIN_SBIN("/usr/local/") ":" PATH_BIN_SBIN("/usr/")
-#define DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/usr/local/") PATH_SBIN_BIN_NULSTR("/usr/")
-#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":" PATH_SBIN_BIN("/")
-#define DEFAULT_USER_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":" PATH_BIN_SBIN("/")
-#define DEFAULT_PATH_SPLIT_USR_NULSTR DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/")
-#define DEFAULT_PATH_COMPAT PATH_SPLIT_SBIN_BIN("/usr/local/") ":" PATH_SPLIT_SBIN_BIN("/usr/") ":" PATH_SPLIT_SBIN_BIN("/")
+#define DEFAULT_PATH_NORMAL "/no-such-path"
+#define DEFAULT_USER_PATH_NORMAL "/no-such-path"
+#define DEFAULT_PATH_NORMAL_NULSTR "/no-such-path\0"
+#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL
+#define DEFAULT_USER_PATH_SPLIT_USR DEFAULT_PATH_NORMAL DEFAULT_PATH_NORMAL
+#define DEFAULT_PATH_SPLIT_USR_NULSTR DEFAULT_PATH_NORMAL_NULSTR
+#define DEFAULT_PATH_COMPAT DEFAULT_PATH_NORMAL
#if HAVE_SPLIT_USR
# define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
--
2.24.1

@ -0,0 +1,33 @@
From 0939ac4be7ced099670979f26adf8a579173ce4b Mon Sep 17 00:00:00 2001
From: Florian Klink <flokli@flokli.de>
Date: Sun, 8 Mar 2020 01:05:54 +0100
Subject: [PATCH] path-util.h: add placeholder for DEFAULT_PATH_NORMAL
This will be the $PATH used to lookup ExecStart= etc. options, which
systemd itself uses extensively.
---
src/basic/path-util.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 111d85d445..cfd92aeb73 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -24,11 +24,11 @@
# define PATH_SBIN_BIN_NULSTR(x) PATH_NORMAL_SBIN_BIN_NULSTR(x)
#endif
-#define DEFAULT_PATH_NORMAL PATH_SBIN_BIN("/usr/local/") ":" PATH_SBIN_BIN("/usr/")
-#define DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/usr/local/") PATH_SBIN_BIN_NULSTR("/usr/")
+#define DEFAULT_PATH_NORMAL "@defaultPathNormal@"
+#define DEFAULT_PATH_NORMAL_NULSTR "@defaultPathNormal@\0"
#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":" PATH_SBIN_BIN("/")
#define DEFAULT_PATH_SPLIT_USR_NULSTR DEFAULT_PATH_NORMAL_NULSTR PATH_SBIN_BIN_NULSTR("/")
-#define DEFAULT_PATH_COMPAT PATH_SPLIT_SBIN_BIN("/usr/local/") ":" PATH_SPLIT_SBIN_BIN("/usr/") ":" PATH_SPLIT_SBIN_BIN("/")
+#define DEFAULT_PATH_COMPAT DEFAULT_PATH_NORMAL
#if HAVE_SPLIT_USR
# define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
--
2.25.1

@ -7,6 +7,7 @@
, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
, ninja, meson, python3Packages, glibcLocales
, patchelf
, substituteAll
, getent
, buildPackages
, perl
@ -30,7 +31,7 @@ let gnupg-minimal = gnupg.override {
bzip2 = null;
};
in stdenv.mkDerivation {
version = "243.7";
version = "244.3";
pname = "systemd";
# When updating, use https://github.com/systemd/systemd-stable tree, not the development one!
@ -38,8 +39,8 @@ in stdenv.mkDerivation {
src = fetchFromGitHub {
owner = "systemd";
repo = "systemd-stable";
rev = "f8dd0f2f15a566ede668c59e3c810c61f9d62c51";
sha256 = "1alvvciddg36by1bgzi8aarnms4crzqqyizj3nhlddh35pgpwvdk";
rev = "c4280c342bbf4fa8da833103482362236c18f835";
sha256 = "0y83nsrbdn0y3wfyfx53ac8c3wy9jrra86aaxix568vigi48g9zi";
};
patches = [
@ -56,13 +57,17 @@ in stdenv.mkDerivation {
./0016-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
./0018-Install-default-configuration-into-out-share-factory.patch
./0019-inherit-systemd-environment-when-calling-generators.patch
./0020-reintroduce-the-no-such-path-PATH-that-was-dropped-s.patch
./0021-add-rootprefix-to-lookup-dir-paths.patch
./0022-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
./0023-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
./0024-kmod-static-nodes.service-Update-ConditionFileNotEmpty.patch
./0025-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
];
postPatch = ''
substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/"
'';
outputs = [ "out" "lib" "man" "dev" ];
nativeBuildInputs =

Loading…
Cancel
Save