1 |
commit: 9cb1e202e281d9fa3ebbf9f354b0672d98743d87 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 8 20:22:01 2021 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 8 20:22:01 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cb1e202 |
7 |
|
8 |
sys-apps/systemd: backport fix for hostnamed |
9 |
|
10 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
11 |
|
12 |
.../files/249-hostnamed-error-variable.patch | 50 ++++++++++++++++++++++ |
13 |
.../{systemd-249.ebuild => systemd-249-r1.ebuild} | 1 + |
14 |
2 files changed, 51 insertions(+) |
15 |
|
16 |
diff --git a/sys-apps/systemd/files/249-hostnamed-error-variable.patch b/sys-apps/systemd/files/249-hostnamed-error-variable.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..7fe7af73a00 |
19 |
--- /dev/null |
20 |
+++ b/sys-apps/systemd/files/249-hostnamed-error-variable.patch |
21 |
@@ -0,0 +1,50 @@ |
22 |
+From 105a4245ff13d588e1e848e8ee3cffd6185bd0ae Mon Sep 17 00:00:00 2001 |
23 |
+From: Jan Palus <jpalus@××××××××.com> |
24 |
+Date: Thu, 8 Jul 2021 00:23:21 +0200 |
25 |
+Subject: [PATCH] hostnamed: correct variable with errno in fallback_chassis |
26 |
+ |
27 |
+fixes assertion failure on arm: |
28 |
+ |
29 |
+systemd-hostnamed[642]: Assertion '(_error) != 0' failed at src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting. |
30 |
+--- |
31 |
+ src/hostname/hostnamed.c | 8 ++++---- |
32 |
+ 1 file changed, 4 insertions(+), 4 deletions(-) |
33 |
+ |
34 |
+diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c |
35 |
+index bd535ddc4d80..36702f2fb0cd 100644 |
36 |
+--- a/src/hostname/hostnamed.c |
37 |
++++ b/src/hostname/hostnamed.c |
38 |
+@@ -204,14 +204,14 @@ static const char* fallback_chassis(void) { |
39 |
+ |
40 |
+ r = read_one_line_file("/sys/class/dmi/id/chassis_type", &type); |
41 |
+ if (r < 0) { |
42 |
+- log_debug_errno(v, "Failed to read DMI chassis type, ignoring: %m"); |
43 |
++ log_debug_errno(r, "Failed to read DMI chassis type, ignoring: %m"); |
44 |
+ goto try_acpi; |
45 |
+ } |
46 |
+ |
47 |
+ r = safe_atou(type, &t); |
48 |
+ free(type); |
49 |
+ if (r < 0) { |
50 |
+- log_debug_errno(v, "Failed to parse DMI chassis type, ignoring: %m"); |
51 |
++ log_debug_errno(r, "Failed to parse DMI chassis type, ignoring: %m"); |
52 |
+ goto try_acpi; |
53 |
+ } |
54 |
+ |
55 |
+@@ -260,14 +260,14 @@ static const char* fallback_chassis(void) { |
56 |
+ try_acpi: |
57 |
+ r = read_one_line_file("/sys/firmware/acpi/pm_profile", &type); |
58 |
+ if (r < 0) { |
59 |
+- log_debug_errno(v, "Failed read ACPI PM profile, ignoring: %m"); |
60 |
++ log_debug_errno(r, "Failed read ACPI PM profile, ignoring: %m"); |
61 |
+ return NULL; |
62 |
+ } |
63 |
+ |
64 |
+ r = safe_atou(type, &t); |
65 |
+ free(type); |
66 |
+ if (r < 0) { |
67 |
+- log_debug_errno(v, "Failed parse ACPI PM profile, ignoring: %m"); |
68 |
++ log_debug_errno(r, "Failed parse ACPI PM profile, ignoring: %m"); |
69 |
+ return NULL; |
70 |
+ } |
71 |
+ |
72 |
|
73 |
diff --git a/sys-apps/systemd/systemd-249.ebuild b/sys-apps/systemd/systemd-249-r1.ebuild |
74 |
similarity index 99% |
75 |
rename from sys-apps/systemd/systemd-249.ebuild |
76 |
rename to sys-apps/systemd/systemd-249-r1.ebuild |
77 |
index 7b82142e7ac..3bc38914353 100644 |
78 |
--- a/sys-apps/systemd/systemd-249.ebuild |
79 |
+++ b/sys-apps/systemd/systemd-249-r1.ebuild |
80 |
@@ -218,6 +218,7 @@ src_prepare() { |
81 |
|
82 |
# Add local patches here |
83 |
PATCHES+=( |
84 |
+ "${FILESDIR}/249-hostnamed-error-variable.patch" |
85 |
) |
86 |
|
87 |
if ! use vanilla; then |