From: Changqing Li <changqing...@windriver.com>

Commit 6fe23ff31c0 changed README to a symlink to README.logs, and
install README.logs under systemd doc dir.

But for OE, systemd doc dir is splited into package systemd-doc, when it
is not installed on the target, there will be an dead link:
Eg:
root@intel-x86-64:/var/log# ls -l README
lrwxrwxrwx 1 root root 39 Jun 20 08:57 README -> 
../../usr/share/doc/systemd/README.logs
root@intel-x86-64:/var/log# ls -l ../../usr/share/doc/systemd/README.logs
ls: cannot access '../../usr/share/doc/systemd/README.logs': No such file or 
directory

First, package this link into systemd-doc to fix above issue.  Second,
Source link path created by systemd is not correct when VOLATILE_LOG_DIR
is true. Create the symlink using absolute path to cover both condition.

Signed-off-by: Changqing Li <changqing...@windriver.com>
---
 meta/recipes-core/systemd/systemd_255.1.bb | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_255.1.bb 
b/meta/recipes-core/systemd/systemd_255.1.bb
index 9e09c89355..73ef0f01b2 100644
--- a/meta/recipes-core/systemd/systemd_255.1.bb
+++ b/meta/recipes-core/systemd/systemd_255.1.bb
@@ -382,10 +382,15 @@ 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
 
-    if [ -n "${WATCHDOG_TIMEOUT}" ]; then
-        sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
-            ${D}/${sysconfdir}/systemd/system.conf
-    fi
+       if [ -n "${WATCHDOG_TIMEOUT}" ]; then
+               sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
+                       ${D}/${sysconfdir}/systemd/system.conf
+       fi
+
+       if grep -q '^L /var/log/README' 
${D}${nonarch_libdir}/tmpfiles.d/legacy.conf 2>/dev/null; then
+               sed -i -e '/^L \/var\/log\/README/d' 
${D}${nonarch_libdir}/tmpfiles.d/legacy.conf
+               echo "L ${localstatedir}/log/README - - - - 
${datadir}/doc/systemd/README.logs" > 
${D}${nonarch_libdir}/tmpfiles.d/legacy-doc.conf
+       fi
 }
 
 python populate_packages:prepend (){
@@ -622,6 +627,8 @@ FILES:${PN}-udev-rules = "\
                         ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
 "
 
+FILES:${PN}-doc  += "${nonarch_libdir}/tmpfiles.d/legacy-doc.conf"
+
 CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \
        ${sysconfdir}/systemd/journald.conf \
        ${sysconfdir}/systemd/logind.conf \
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196242): 
https://lists.openembedded.org/g/openembedded-core/message/196242
Mute This Topic: https://lists.openembedded.org/mt/104598170/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