diff options
author | Matthias Schiffer <matthias.schiffer@ew.tq-group.com> | 2019-07-10 14:13:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-16 13:53:17 +0100 |
commit | c412e3d6a319ef4d957fb607a4c34b36551b5073 (patch) | |
tree | d7522b7e5bc10282444d1666d6f520c6d48709b8 /meta/recipes-core | |
parent | 2381806f26a8c9184e173f00b5d1ab0ca103ddfc (diff) | |
download | poky-c412e3d6a319ef4d957fb607a4c34b36551b5073.tar.gz |
systemd: backport patch to fix sysctl warning on boot
Due to improved validation of sysctl settings in recent kernels (5.2+, but
also stable kernels like 4.19.53), systemd will log an error message like
systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
during boot. Backport the bugfix from the systemd master.
(From OE-Core rev: 289a29fc687d1224097f553a6f8c7f1baf903cae)
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch | 39 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd_242.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch new file mode 100644 index 0000000000..ff64f58c9c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 6e2f78948403a4cce45b9e34311c9577c624f066 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lennart Poettering <lennart@poettering.net> | ||
3 | Date: Mon, 17 Jun 2019 10:51:25 +0200 | ||
4 | Subject: [PATCH] core: set fs.file-max sysctl to LONG_MAX rather than | ||
5 | ULONG_MAX | ||
6 | |||
7 | Since kernel 5.2 the kernel thankfully returns proper errors when we | ||
8 | write a value out of range to the sysctl. Which however breaks writing | ||
9 | ULONG_MAX to request the maximum value. Hence let's write the new | ||
10 | maximum value instead, LONG_MAX. | ||
11 | |||
12 | /cc @brauner | ||
13 | |||
14 | Fixes: #12803 | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | |||
18 | Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> | ||
19 | --- | ||
20 | src/core/main.c | 6 +++--- | ||
21 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
22 | |||
23 | diff --git a/src/core/main.c b/src/core/main.c | ||
24 | index b33ea1b5b5..e7f51815f0 100644 | ||
25 | --- a/src/core/main.c | ||
26 | +++ b/src/core/main.c | ||
27 | @@ -1245,9 +1245,9 @@ static void bump_file_max_and_nr_open(void) { | ||
28 | #endif | ||
29 | |||
30 | #if BUMP_PROC_SYS_FS_FILE_MAX | ||
31 | - /* I so wanted to use STRINGIFY(ULONG_MAX) here, but alas we can't as glibc/gcc define that as | ||
32 | - * "(0x7fffffffffffffffL * 2UL + 1UL)". Seriously. 😢 */ | ||
33 | - if (asprintf(&t, "%lu\n", ULONG_MAX) < 0) { | ||
34 | + /* The maximum the kernel allows for this since 5.2 is LONG_MAX, use that. (Previously thing where | ||
35 | + * different but the operation would fail silently.) */ | ||
36 | + if (asprintf(&t, "%li\n", LONG_MAX) < 0) { | ||
37 | log_oom(); | ||
38 | return; | ||
39 | } | ||
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb index 29f64b995a..ca083ad376 100644 --- a/meta/recipes-core/systemd/systemd_242.bb +++ b/meta/recipes-core/systemd/systemd_242.bb | |||
@@ -25,6 +25,7 @@ SRC_URI += "file://touchscreen.rules \ | |||
25 | file://0006-network-remove-redunant-link-name-in-message.patch \ | 25 | file://0006-network-remove-redunant-link-name-in-message.patch \ |
26 | file://99-default.preset \ | 26 | file://99-default.preset \ |
27 | file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \ | 27 | file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \ |
28 | file://0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | # patches needed by musl | 31 | # patches needed by musl |