From: Mingli Yu <mingli...@windriver.com>

Fixes:
 # systemd-analyze --man=false verify /lib/systemd/system/systemd-kexec.service
 systemd-kexec.service: Command systemctl is not executable: No such file or 
directory

Signed-off-by: Mingli Yu <mingli...@windriver.com>
---
 .../0001-service-use-the-abosolute-path.patch | 253 ++++++++++++++++++
 meta/recipes-core/systemd/systemd_247.2.bb    |   5 +
 2 files changed, 258 insertions(+)
 create mode 100644 
meta/recipes-core/systemd/systemd/0001-service-use-the-abosolute-path.patch

diff --git 
a/meta/recipes-core/systemd/systemd/0001-service-use-the-abosolute-path.patch 
b/meta/recipes-core/systemd/systemd/0001-service-use-the-abosolute-path.patch
new file mode 100644
index 0000000000..dc8e8b3052
--- /dev/null
+++ 
b/meta/recipes-core/systemd/systemd/0001-service-use-the-abosolute-path.patch
@@ -0,0 +1,253 @@
+From 98a60faaca7f1a6b753f73556705cc68aa19e383 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli...@windriver.com>
+Date: Thu, 7 Jan 2021 06:40:29 +0000
+Subject: [PATCH] service: use the abosolute path
+
+Fixes:
+ # systemd-analyze --man=false verify /lib/systemd/system/systemd-kexec.service
+ systemd-kexec.service: Command systemctl is not executable: No such file or 
directory
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Mingli Yu <mingli...@windriver.com>
+---
+ units/initrd-cleanup.service                 | 2 +-
+ units/initrd-switch-root.service             | 2 +-
+ units/systemd-ask-password-console.service   | 2 +-
+ units/systemd-ask-password-wall.service      | 2 +-
+ units/systemd-halt.service                   | 2 +-
+ units/systemd-hwdb-update.service.in         | 2 +-
+ units/systemd-journal-catalog-update.service | 2 +-
+ units/systemd-journal-flush.service          | 4 ++--
+ units/systemd-kexec.service                  | 2 +-
+ units/systemd-machine-id-commit.service      | 2 +-
+ units/systemd-sysusers.service               | 2 +-
+ units/systemd-tmpfiles-clean.service         | 2 +-
+ units/systemd-tmpfiles-setup-dev.service     | 2 +-
+ units/systemd-tmpfiles-setup.service         | 2 +-
+ units/systemd-udev-settle.service            | 2 +-
+ units/systemd-udev-trigger.service           | 4 ++--
+ units/systemd-udevd.service.in               | 2 +-
+ units/user/systemd-tmpfiles-clean.service    | 2 +-
+ units/user/systemd-tmpfiles-setup.service    | 2 +-
+ 19 files changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/units/initrd-cleanup.service b/units/initrd-cleanup.service
+index 08ab503962..231dbda0c0 100644
+--- a/units/initrd-cleanup.service
++++ b/units/initrd-cleanup.service
+@@ -17,4 +17,4 @@ After=initrd-root-fs.target initrd-fs.target initrd.target
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemctl --no-block isolate initrd-switch-root.target
++ExecStart=#BASE_BINDIR#/systemctl --no-block isolate initrd-switch-root.target
+diff --git a/units/initrd-switch-root.service 
b/units/initrd-switch-root.service
+index e3d6926711..a18b94df2d 100644
+--- a/units/initrd-switch-root.service
++++ b/units/initrd-switch-root.service
+@@ -17,4 +17,4 @@ AllowIsolate=yes
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemctl --no-block switch-root /sysroot
++ExecStart=#BASE_BINDIR#/systemctl --no-block switch-root /sysroot
+diff --git a/units/systemd-ask-password-console.service 
b/units/systemd-ask-password-console.service
+index d31f3fa70f..16abf1af1f 100644
+--- a/units/systemd-ask-password-console.service
++++ b/units/systemd-ask-password-console.service
+@@ -17,5 +17,5 @@ Before=shutdown.target
+ ConditionPathExists=!/run/plymouth/pid
+ 
+ [Service]
+-ExecStart=systemd-tty-ask-password-agent --watch --console
++ExecStart=#BASE_BINDIR#/systemd-tty-ask-password-agent --watch --console
+ SystemCallArchitectures=native
+diff --git a/units/systemd-ask-password-wall.service 
b/units/systemd-ask-password-wall.service
+index 6a70b58cef..b30da07865 100644
+--- a/units/systemd-ask-password-wall.service
++++ b/units/systemd-ask-password-wall.service
+@@ -14,5 +14,5 @@ After=systemd-user-sessions.service
+ 
+ [Service]
+ ExecStartPre=-systemctl stop systemd-ask-password-console.path 
systemd-ask-password-console.service systemd-ask-password-plymouth.path 
systemd-ask-password-plymouth.service
+-ExecStart=systemd-tty-ask-password-agent --wall
++ExecStart=#BASE_BINDIR#/systemd-tty-ask-password-agent --wall
+ SystemCallArchitectures=native
+diff --git a/units/systemd-halt.service b/units/systemd-halt.service
+index 37bfe285c0..f5b27f9bba 100644
+--- a/units/systemd-halt.service
++++ b/units/systemd-halt.service
+@@ -16,4 +16,4 @@ After=shutdown.target umount.target final.target
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemctl --force halt
++ExecStart=#BASE_BINDIR#/systemctl --force halt
+diff --git a/units/systemd-hwdb-update.service.in 
b/units/systemd-hwdb-update.service.in
+index 57398e5214..2b6a523598 100644
+--- a/units/systemd-hwdb-update.service.in
++++ b/units/systemd-hwdb-update.service.in
+@@ -22,5 +22,5 @@ ConditionDirectoryNotEmpty=|/etc/udev/hwdb.d/
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-hwdb update
++ExecStart=#BASE_BINDIR#/systemd-hwdb update
+ TimeoutSec=90s
+diff --git a/units/systemd-journal-catalog-update.service 
b/units/systemd-journal-catalog-update.service
+index 477925685a..2a29e4e910 100644
+--- a/units/systemd-journal-catalog-update.service
++++ b/units/systemd-journal-catalog-update.service
+@@ -19,5 +19,5 @@ ConditionNeedsUpdate=/var
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=journalctl --update-catalog
++ExecStart=#BASE_BINDIR#/journalctl --update-catalog
+ TimeoutSec=90s
+diff --git a/units/systemd-journal-flush.service 
b/units/systemd-journal-flush.service
+index 1a71592b93..1a4d189b51 100644
+--- a/units/systemd-journal-flush.service
++++ b/units/systemd-journal-flush.service
+@@ -17,8 +17,8 @@ Before=systemd-tmpfiles-setup.service
+ RequiresMountsFor=/var/log/journal
+ 
+ [Service]
+-ExecStart=journalctl --flush
+-ExecStop=journalctl --smart-relinquish-var
++ExecStart=#BASE_BINDIR#/journalctl --flush
++ExecStop=#BASE_BINDIR#/journalctl --smart-relinquish-var
+ Type=oneshot
+ RemainAfterExit=yes
+ TimeoutSec=90s
+diff --git a/units/systemd-kexec.service b/units/systemd-kexec.service
+index 0aa7933be4..6977b6faf4 100644
+--- a/units/systemd-kexec.service
++++ b/units/systemd-kexec.service
+@@ -16,4 +16,4 @@ After=shutdown.target umount.target final.target
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemctl --force kexec
++ExecStart=#BASE_BINDIR#/systemctl --force kexec
+diff --git a/units/systemd-machine-id-commit.service 
b/units/systemd-machine-id-commit.service
+index 89e0613955..8ae8f59c69 100644
+--- a/units/systemd-machine-id-commit.service
++++ b/units/systemd-machine-id-commit.service
+@@ -20,5 +20,5 @@ ConditionPathIsMountPoint=/etc/machine-id
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-machine-id-setup --commit
++ExecStart=#BASE_BINDIR#/systemd-machine-id-setup --commit
+ TimeoutSec=30s
+diff --git a/units/systemd-sysusers.service b/units/systemd-sysusers.service
+index ff5b3db821..735be55094 100644
+--- a/units/systemd-sysusers.service
++++ b/units/systemd-sysusers.service
+@@ -19,5 +19,5 @@ ConditionNeedsUpdate=/etc
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-sysusers
++ExecStart=#BASE_BINDIR#/systemd-sysusers
+ TimeoutSec=90s
+diff --git a/units/systemd-tmpfiles-clean.service 
b/units/systemd-tmpfiles-clean.service
+index e962954f06..071d8492b2 100644
+--- a/units/systemd-tmpfiles-clean.service
++++ b/units/systemd-tmpfiles-clean.service
+@@ -17,6 +17,6 @@ Before=shutdown.target
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemd-tmpfiles --clean
++ExecStart=#BASE_BINDIR#/systemd-tmpfiles --clean
+ SuccessExitStatus=DATAERR
+ IOSchedulingClass=idle
+diff --git a/units/systemd-tmpfiles-setup-dev.service 
b/units/systemd-tmpfiles-setup-dev.service
+index 0babe78767..f531f175d5 100644
+--- a/units/systemd-tmpfiles-setup-dev.service
++++ b/units/systemd-tmpfiles-setup-dev.service
+@@ -18,5 +18,5 @@ Before=sysinit.target local-fs-pre.target 
systemd-udevd.service shutdown.target
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-tmpfiles --prefix=/dev --create --boot
++ExecStart=#BASE_BINDIR#/systemd-tmpfiles --prefix=/dev --create --boot
+ SuccessExitStatus=DATAERR CANTCREAT
+diff --git a/units/systemd-tmpfiles-setup.service 
b/units/systemd-tmpfiles-setup.service
+index 3f028d2533..93bb7a2775 100644
+--- a/units/systemd-tmpfiles-setup.service
++++ b/units/systemd-tmpfiles-setup.service
+@@ -19,5 +19,5 @@ RefuseManualStop=yes
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
++ExecStart=#BASE_BINDIR#/systemd-tmpfiles --create --remove --boot 
--exclude-prefix=/dev
+ SuccessExitStatus=DATAERR CANTCREAT
+diff --git a/units/systemd-udev-settle.service 
b/units/systemd-udev-settle.service
+index 994c47fce4..3a4f03ed1b 100644
+--- a/units/systemd-udev-settle.service
++++ b/units/systemd-udev-settle.service
+@@ -24,4 +24,4 @@ ConditionPathIsReadWrite=/sys
+ Type=oneshot
+ TimeoutSec=180
+ RemainAfterExit=yes
+-ExecStart=udevadm settle
++ExecStart=#BASE_BINDIR#/udevadm settle
+diff --git a/units/systemd-udev-trigger.service 
b/units/systemd-udev-trigger.service
+index 8b2d88e185..b4012af5c7 100644
+--- a/units/systemd-udev-trigger.service
++++ b/units/systemd-udev-trigger.service
+@@ -19,5 +19,5 @@ ConditionPathIsReadWrite=/sys
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=udevadm trigger --type=subsystems --action=add
+-ExecStart=udevadm trigger --type=devices --action=add
++ExecStart=#BASE_BINDIR#/udevadm trigger --type=subsystems --action=add
++ExecStart=#BASE_BINDIR#/udevadm trigger --type=devices --action=add
+diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
+index f3458d98e6..c36ddbf843 100644
+--- a/units/systemd-udevd.service.in
++++ b/units/systemd-udevd.service.in
+@@ -25,7 +25,7 @@ Sockets=systemd-udevd-control.socket 
systemd-udevd-kernel.socket
+ Restart=always
+ RestartSec=0
+ ExecStart=@rootlibexecdir@/systemd-udevd
+-ExecReload=udevadm control --reload --timeout 0
++ExecReload=#BASE_BINDIR#/udevadm control --reload --timeout 0
+ KillMode=mixed
+ TasksMax=infinity
+ PrivateMounts=yes
+diff --git a/units/user/systemd-tmpfiles-clean.service 
b/units/user/systemd-tmpfiles-clean.service
+index 6a937071f7..004f1ca1d9 100644
+--- a/units/user/systemd-tmpfiles-clean.service
++++ b/units/user/systemd-tmpfiles-clean.service
+@@ -16,7 +16,7 @@ Before=basic.target shutdown.target
+ 
+ [Service]
+ Type=oneshot
+-ExecStart=systemd-tmpfiles --user --clean
++ExecStart=#BASE_BINDIR#/systemd-tmpfiles --user --clean
+ SuccessExitStatus=DATAERR
+ IOSchedulingClass=idle
+ Slice=background.slice
+diff --git a/units/user/systemd-tmpfiles-setup.service 
b/units/user/systemd-tmpfiles-setup.service
+index 156689edcd..bda5a3d22f 100644
+--- a/units/user/systemd-tmpfiles-setup.service
++++ b/units/user/systemd-tmpfiles-setup.service
+@@ -18,7 +18,7 @@ RefuseManualStop=yes
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=systemd-tmpfiles --user --create --remove --boot
++ExecStart=#BASE_BINDIR#/systemd-tmpfiles --user --create --remove --boot
+ SuccessExitStatus=DATAERR
+ 
+ [Install]
+-- 
+2.26.2
+
diff --git a/meta/recipes-core/systemd/systemd_247.2.bb 
b/meta/recipes-core/systemd/systemd_247.2.bb
index 8416a522c6..8f8d461924 100644
--- a/meta/recipes-core/systemd/systemd_247.2.bb
+++ b/meta/recipes-core/systemd/systemd_247.2.bb
@@ -23,6 +23,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0003-implment-systemd-sysv-install-for-OE.patch \
            
file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \
            
file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \
+           file://0001-service-use-the-abosolute-path.patch \
            "
 
 # patches needed by musl
@@ -321,6 +322,10 @@ do_install() {
 
        # add a profile fragment to disable systemd pager with busybox less
        install -Dm 0644 ${WORKDIR}/systemd-pager.sh 
${D}${sysconfdir}/profile.d/systemd-pager.sh
+
+       # use the absolute path for the command in the service file
+       files=$(ls ${D}${systemd_unitdir}/system/*.service)
+       for i in ${files}; do sed -i -e 's:#BASE_BINDIR#:${base_bindir}:g' $i; 
done
 }
 
 python populate_packages_prepend (){
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#146464): 
https://lists.openembedded.org/g/openembedded-core/message/146464
Mute This Topic: https://lists.openembedded.org/mt/79495822/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to