1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-07 16:59:22 +00:00

systemd: update 252.5 -> 253.1

Add a musl compatibility patch to systemd-boot.

Backport a patch to address systemctl fails on 32 bit targets.

(From OE-Core rev: d92f0f3597acba6cfc55a8cf2e7249efc6573c6a)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2023-03-09 16:19:37 +01:00
committed by Richard Purdie
parent 03e900a748
commit ca6326803c
5 changed files with 88 additions and 3 deletions
+5 -3
View File
@@ -14,9 +14,11 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
SRCREV = "61f5710d0bfd8f522af6f8eef399a851509946e2"
SRCBRANCH = "v252-stable"
SRCREV = "6c327d74aa0d350482e82a247d7018559699798d"
SRCBRANCH = "v253-stable"
SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \
"
file://0004-src-boot-efi-efi-string.c-define-wchar_t-from-__WCHA.patch \
file://fix-32bit.patch \
"
S = "${WORKDIR}/git"
@@ -0,0 +1,40 @@
From a4ff7772acf1d983921833aa20ccd7c4d5e59a1c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 6 Mar 2023 15:24:49 +0100
Subject: [PATCH] src/boot/efi/efi-string.c: define wchar_t from __WCHAR_TYPE__
systemd-boot relies on wchar_t being 16 bit, and breaks at build time otherwise.
To set wchar_t to 16 bit it is passing -fshort-wchar to gcc; this has the
desired effect on glibc (which sets wchar_t from __WCHAR_TYPE__) but not on
musl (which hardcodes it to 32 bit).
This patch ensures wchar_t is set from the compiler flags on all systems; note
that systemd-boot is not actually using functions from musl or other libc, just their headers.
Meanwhile upstream has refactored the code to not rely on libc headers at all;
however this will not be backported to v253 and we need a different fix.
Upstream-Status: Inappropriate [fixed differently in trunk according to https://github.com/systemd/systemd/pull/26689]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/boot/efi/efi-string.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c
index 22923d60f6..22a8d1ef71 100644
--- a/src/boot/efi/efi-string.c
+++ b/src/boot/efi/efi-string.c
@@ -2,7 +2,12 @@
#include <stdbool.h>
#include <stdint.h>
+
+#if SD_BOOT
+typedef __WCHAR_TYPE__ wchar_t;
+#else
#include <wchar.h>
+#endif
#include "efi-string.h"
@@ -0,0 +1,41 @@
From c63bfd0884cf20e48befbee49d41f667660a8802 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Fri, 3 Mar 2023 12:17:27 +0100
Subject: [PATCH] systemctl: explicitly cast the constants to uint64_t
Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:
$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.
$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument
(reproduced on an armv7hl machine)
Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/c63bfd0884cf20e48befbee49d41f667660a8802]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/systemctl/systemctl-enable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c
index 4ebe5888ac69..a9c6f3a742c9 100644
--- a/src/systemctl/systemctl-enable.c
+++ b/src/systemctl/systemctl-enable.c
@@ -211,7 +211,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
if (send_runtime) {
if (streq(method, "DisableUnitFilesWithFlagsAndInstallInfo"))
- r = sd_bus_message_append(m, "t", arg_runtime ? UNIT_FILE_RUNTIME : 0);
+ r = sd_bus_message_append(m, "t", arg_runtime ? (uint64_t) UNIT_FILE_RUNTIME : UINT64_C(0));
else
r = sd_bus_message_append(m, "b", arg_runtime);
if (r < 0)
@@ -57,6 +57,7 @@ PAM_PLUGINS = " \
pam-plugin-unix \
pam-plugin-loginuid \
pam-plugin-keyinit \
pam-plugin-namespace \
"
PACKAGECONFIG ??= " \
@@ -715,6 +716,7 @@ FILES:udev += "${base_sbindir}/udevd \
${rootlibexecdir}/udev/rules.d/60-drm.rules \
${rootlibexecdir}/udev/rules.d/60-evdev.rules \
${rootlibexecdir}/udev/rules.d/60-fido-id.rules \
${rootlibexecdir}/udev/rules.d/60-infiniband.rules \
${rootlibexecdir}/udev/rules.d/60-input-id.rules \
${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \
${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \