summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-09-27 14:42:51 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-30 16:55:21 +0100
commitb83d5c15adcc2d106194d85dd1b0496678c675e1 (patch)
treeb74a7f18734aab096f125d00d6630ecaf1e97ec3 /meta
parent15d6add800ab806ba344272949948e094440fba1 (diff)
downloadpoky-b83d5c15adcc2d106194d85dd1b0496678c675e1.tar.gz
systemd: fix NFS regression
Currently systemd cannot boot correctly on NFS. This is because the code uses readdir which returns DT_UNKNOWN instead of DT_LNK on NFS. So consider DT_UNKNOWN to fix this problem. (From OE-Core rev: 9973f89dafdf9d21f4021f59f1f4669f4ac13aff) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch42
-rw-r--r--meta/recipes-core/systemd/systemd_243.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch b/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch
new file mode 100644
index 0000000000..ba20a0bb46
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch
@@ -0,0 +1,42 @@
1From d0122c077d2d8fd0fd29b463c501e7ddf9177ff3 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 24 Sep 2019 17:04:50 +0800
4Subject: [PATCH] unit-file.c: consider symlink on filesystems like NFS
5
6Some filesystems do not fully support readdir, according to the manual,
7so we should also consider DT_UNKNOWN to correctly handle symlinks.
8
9Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
10
11Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/13637]
12---
13 src/shared/unit-file.c | 6 +++++-
14 1 file changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c
17index 4a5f23e6c1..8373103000 100644
18--- a/src/shared/unit-file.c
19+++ b/src/shared/unit-file.c
20@@ -247,6 +247,7 @@ int unit_file_build_name_map(
21 _cleanup_free_ char *_filename_free = NULL, *simplified = NULL;
22 const char *suffix, *dst = NULL;
23 bool valid_unit_name;
24+ struct stat sb;
25
26 valid_unit_name = unit_name_is_valid(de->d_name, UNIT_NAME_ANY);
27
28@@ -279,7 +280,10 @@ int unit_file_build_name_map(
29 if (hashmap_contains(ids, de->d_name))
30 continue;
31
32- if (de->d_type == DT_LNK) {
33+ if (de->d_type == DT_LNK ||
34+ (de->d_type == DT_UNKNOWN &&
35+ lstat(filename, &sb) == 0 &&
36+ (sb.st_mode & S_IFMT) == S_IFLNK)) {
37 /* We don't explicitly check for alias loops here. unit_ids_map_get() which
38 * limits the number of hops should be used to access the map. */
39
40--
412.17.1
42
diff --git a/meta/recipes-core/systemd/systemd_243.bb b/meta/recipes-core/systemd/systemd_243.bb
index d0f9d17dba..eaa12ed107 100644
--- a/meta/recipes-core/systemd/systemd_243.bb
+++ b/meta/recipes-core/systemd/systemd_243.bb
@@ -22,6 +22,7 @@ SRC_URI += "file://touchscreen.rules \
22 file://0003-implment-systemd-sysv-install-for-OE.patch \ 22 file://0003-implment-systemd-sysv-install-for-OE.patch \
23 file://0004-rules-whitelist-hd-devices.patch \ 23 file://0004-rules-whitelist-hd-devices.patch \
24 file://0005-rules-watch-metadata-changes-in-ide-devices.patch \ 24 file://0005-rules-watch-metadata-changes-in-ide-devices.patch \
25 file://0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch \
25 file://99-default.preset \ 26 file://99-default.preset \
26 " 27 "
27 28