mirror of
https://git.yoctoproject.org/poky
synced 2026-01-12 03:10:06 +00:00
systemd-systemctl-native: Install systemd-sysv-install
It is needed when support for both systemd and sysvinit are enabled. This also adds a patch for systemctl to call systemd-sysv-install without a hardcoded path and instead relies on finding it in $PATH. This is needed when calling systemctl from a recipe sysroot. (From OE-Core rev: 8d0eb4ff49801aabb73e4fa28ffe12ab10beb32b) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
ef043f337c
commit
3d625d8263
@@ -1,9 +1,14 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
|
||||
|
||||
SUMMARY = "Systemctl executable from systemd"
|
||||
|
||||
require systemd.inc
|
||||
|
||||
DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native"
|
||||
|
||||
SRC_URI += "file://0001-systemctl-Call-systemd-sysv-install-without-path.patch"
|
||||
SRC_URI += "file://0002-implment-systemd-sysv-install-for-OE.patch"
|
||||
|
||||
inherit pkgconfig meson native
|
||||
|
||||
MESON_TARGET = "systemctl:executable"
|
||||
@@ -14,3 +19,9 @@ EXTRA_OEMESON += "-Dlink-systemctl-shared=false"
|
||||
# determined at run-time, but rather set during configure
|
||||
# More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887
|
||||
EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}"
|
||||
|
||||
do_install:append() {
|
||||
# Install systemd-sysv-install in /usr/bin rather than /usr/lib/systemd
|
||||
# (where it is normally installed) so systemctl can find it in $PATH.
|
||||
install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${bindir}/systemd-sysv-install
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 34c8551a8b16bf235a1ebe8d9cb1a3474a7c975e Mon Sep 17 00:00:00 2001
|
||||
From: Peter Kjellerstedt <pkj@axis.com>
|
||||
Date: Fri, 22 Aug 2025 18:07:28 +0200
|
||||
Subject: [PATCH] systemctl: Call systemd-sysv-install without path
|
||||
|
||||
Expect to find systemd-sysv-install in $PATH instead of hardcoding the
|
||||
path to it, as the latter does not work when running systemctl from a
|
||||
recipe sysroot.
|
||||
|
||||
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
|
||||
Upstream-Status: Inappropriate [OE specific]
|
||||
---
|
||||
src/systemctl/systemctl-sysv-compat.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/systemctl/systemctl-sysv-compat.c b/src/systemctl/systemctl-sysv-compat.c
|
||||
index cb9c43e3dc..e44ef9f64e 100644
|
||||
--- a/src/systemctl/systemctl-sysv-compat.c
|
||||
+++ b/src/systemctl/systemctl-sysv-compat.c
|
||||
@@ -140,7 +140,7 @@ int enable_sysv_units(const char *verb, char **args) {
|
||||
while (args[f]) {
|
||||
|
||||
const char *argv[] = {
|
||||
- LIBEXECDIR "/systemd-sysv-install",
|
||||
+ "systemd-sysv-install",
|
||||
NULL, /* --root= */
|
||||
NULL, /* verb */
|
||||
NULL, /* service */
|
||||
@@ -218,7 +218,7 @@ int enable_sysv_units(const char *verb, char **args) {
|
||||
return j;
|
||||
if (j == 0) {
|
||||
/* Child */
|
||||
- execv(argv[0], (char**) argv);
|
||||
+ execvp(argv[0], (char**) argv);
|
||||
log_error_errno(errno, "Failed to execute %s: %m", argv[0]);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
From fab8c573d06340868f070446118673b1c23584c5 Mon Sep 17 00:00:00 2001
|
||||
From 4a5602ede9881fd8e578a3c8bc40dd5df7c4d802 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 5 Sep 2015 06:31:47 +0000
|
||||
Subject: [PATCH 02/26] implment systemd-sysv-install for OE
|
||||
Subject: [PATCH] implement systemd-sysv-install for OE
|
||||
|
||||
Use update-rc.d for enabling/disabling and status command
|
||||
to check the status of the sysv service
|
||||
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
|
||||
index cb58d8243b..000bdf6165 100755
|
||||
index cb58d8243b..eff3f5f579 100755
|
||||
--- a/src/systemctl/systemd-sysv-install.SKELETON
|
||||
+++ b/src/systemctl/systemd-sysv-install.SKELETON
|
||||
@@ -34,17 +34,17 @@ case "$1" in
|
||||
@@ -22,13 +22,13 @@ index cb58d8243b..000bdf6165 100755
|
||||
# call the command to enable SysV init script $NAME here
|
||||
# (consider optional $ROOT)
|
||||
- echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
|
||||
+ update-rc.d -f $NAME defaults
|
||||
+ update-rc.d ${ROOT:+-r $ROOT} -f $NAME defaults
|
||||
;;
|
||||
disable)
|
||||
# call the command to disable SysV init script $NAME here
|
||||
# (consider optional $ROOT)
|
||||
- echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
|
||||
+ update-rc.d -f $NAME remove
|
||||
+ update-rc.d ${ROOT:+-r $ROOT} -f $NAME remove
|
||||
;;
|
||||
is-enabled)
|
||||
# exit with 0 if $NAME is enabled, non-zero if it is disabled
|
||||
@@ -38,6 +38,3 @@ index cb58d8243b..000bdf6165 100755
|
||||
;;
|
||||
*)
|
||||
usage ;;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user