summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/systemd/systemd-systemctl-native_257.6.bb11
-rw-r--r--meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch37
-rw-r--r--meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch13
3 files changed, 53 insertions, 8 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl-native_257.6.bb b/meta/recipes-core/systemd/systemd-systemctl-native_257.6.bb
index 041a040a26..4486edf651 100644
--- a/meta/recipes-core/systemd/systemd-systemctl-native_257.6.bb
+++ b/meta/recipes-core/systemd/systemd-systemctl-native_257.6.bb
@@ -1,9 +1,14 @@
1FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
2
1SUMMARY = "Systemctl executable from systemd" 3SUMMARY = "Systemctl executable from systemd"
2 4
3require systemd.inc 5require systemd.inc
4 6
5DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native" 7DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native"
6 8
9SRC_URI += "file://0001-systemctl-Call-systemd-sysv-install-without-path.patch"
10SRC_URI += "file://0002-implment-systemd-sysv-install-for-OE.patch"
11
7inherit pkgconfig meson native 12inherit pkgconfig meson native
8 13
9MESON_TARGET = "systemctl:executable" 14MESON_TARGET = "systemctl:executable"
@@ -14,3 +19,9 @@ EXTRA_OEMESON += "-Dlink-systemctl-shared=false"
14# determined at run-time, but rather set during configure 19# determined at run-time, but rather set during configure
15# More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887 20# More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887
16EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}" 21EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}"
22
23do_install:append() {
24 # Install systemd-sysv-install in /usr/bin rather than /usr/lib/systemd
25 # (where it is normally installed) so systemctl can find it in $PATH.
26 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${bindir}/systemd-sysv-install
27}
diff --git a/meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch b/meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch
new file mode 100644
index 0000000000..bf08dbe9b0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch
@@ -0,0 +1,37 @@
1From 34c8551a8b16bf235a1ebe8d9cb1a3474a7c975e Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Fri, 22 Aug 2025 18:07:28 +0200
4Subject: [PATCH] systemctl: Call systemd-sysv-install without path
5
6Expect to find systemd-sysv-install in $PATH instead of hardcoding the
7path to it, as the latter does not work when running systemctl from a
8recipe sysroot.
9
10Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
11Upstream-Status: Inappropriate [OE specific]
12---
13 src/systemctl/systemctl-sysv-compat.c | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/src/systemctl/systemctl-sysv-compat.c b/src/systemctl/systemctl-sysv-compat.c
17index cb9c43e3dc..e44ef9f64e 100644
18--- a/src/systemctl/systemctl-sysv-compat.c
19+++ b/src/systemctl/systemctl-sysv-compat.c
20@@ -140,7 +140,7 @@ int enable_sysv_units(const char *verb, char **args) {
21 while (args[f]) {
22
23 const char *argv[] = {
24- LIBEXECDIR "/systemd-sysv-install",
25+ "systemd-sysv-install",
26 NULL, /* --root= */
27 NULL, /* verb */
28 NULL, /* service */
29@@ -218,7 +218,7 @@ int enable_sysv_units(const char *verb, char **args) {
30 return j;
31 if (j == 0) {
32 /* Child */
33- execv(argv[0], (char**) argv);
34+ execvp(argv[0], (char**) argv);
35 log_error_errno(errno, "Failed to execute %s: %m", argv[0]);
36 _exit(EXIT_FAILURE);
37 }
diff --git a/meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch
index d8bb572261..98d050ceae 100644
--- a/meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch
+++ b/meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch
@@ -1,7 +1,7 @@
1From fab8c573d06340868f070446118673b1c23584c5 Mon Sep 17 00:00:00 2001 1From 4a5602ede9881fd8e578a3c8bc40dd5df7c4d802 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 5 Sep 2015 06:31:47 +0000 3Date: Sat, 5 Sep 2015 06:31:47 +0000
4Subject: [PATCH 02/26] implment systemd-sysv-install for OE 4Subject: [PATCH] implement systemd-sysv-install for OE
5 5
6Use update-rc.d for enabling/disabling and status command 6Use update-rc.d for enabling/disabling and status command
7to check the status of the sysv service 7to check the status of the sysv service
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 3 insertions(+), 3 deletions(-) 14 1 file changed, 3 insertions(+), 3 deletions(-)
15 15
16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON 16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
17index cb58d8243b..000bdf6165 100755 17index cb58d8243b..eff3f5f579 100755
18--- a/src/systemctl/systemd-sysv-install.SKELETON 18--- a/src/systemctl/systemd-sysv-install.SKELETON
19+++ b/src/systemctl/systemd-sysv-install.SKELETON 19+++ b/src/systemctl/systemd-sysv-install.SKELETON
20@@ -34,17 +34,17 @@ case "$1" in 20@@ -34,17 +34,17 @@ case "$1" in
@@ -22,13 +22,13 @@ index cb58d8243b..000bdf6165 100755
22 # call the command to enable SysV init script $NAME here 22 # call the command to enable SysV init script $NAME here
23 # (consider optional $ROOT) 23 # (consider optional $ROOT)
24- echo "IMPLEMENT ME: enabling SysV init.d script $NAME" 24- echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
25+ update-rc.d -f $NAME defaults 25+ update-rc.d ${ROOT:+-r $ROOT} -f $NAME defaults
26 ;; 26 ;;
27 disable) 27 disable)
28 # call the command to disable SysV init script $NAME here 28 # call the command to disable SysV init script $NAME here
29 # (consider optional $ROOT) 29 # (consider optional $ROOT)
30- echo "IMPLEMENT ME: disabling SysV init.d script $NAME" 30- echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
31+ update-rc.d -f $NAME remove 31+ update-rc.d ${ROOT:+-r $ROOT} -f $NAME remove
32 ;; 32 ;;
33 is-enabled) 33 is-enabled)
34 # exit with 0 if $NAME is enabled, non-zero if it is disabled 34 # exit with 0 if $NAME is enabled, non-zero if it is disabled
@@ -38,6 +38,3 @@ index cb58d8243b..000bdf6165 100755
38 ;; 38 ;;
39 *) 39 *)
40 usage ;; 40 usage ;;
41--
422.34.1
43