On 2/27/24 17:28, Alexander Kanavin wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

The patch description doesn't match the patch content. The packaging
doesn't change for README items, and VOLATILE_LOG_DIR isn't checked
anywhere.

This patch is for fixing two problems:

1.

Currently,  There is one line in /usr/lib/tmpfile.d/legacy.conf(this is in package systemd),

"L /var/log/README - - - - ../../usr/share/doc/systemd/README.logs"

This line will create an link to "${datadir}/doc/systemd/README.logs" during boot,

and ${datadir}/doc/systemd/README.logs is in package systemd-doc. So there will be dead link when systemd-doc is not installed.

So that's why I create another legacy-doc.conf packaged into systemd-doc

2.

The symlink in legacy.conf use relative path.  but for oe, whenVOLATILE_LOG_DIR is true, /var/log is a link to /var/volatile/log, so

/var/log/README need link to ../../../usr/share/doc/systemd/README.logs,

while VOLATILE_LOG_DIR is false, /var/log is a dir, so /var/log/README

need link to ../../usr/share/doc/systemd/README.logs.

After change it to absolute path, checking of VOLATILE_LOG_DIR is not needed.


Also, don't tweak WATCHDOR_TIMEOUT block, it's not relevant, and hard
to tell if something changed there.
ok

I would rather suggest packaging the needed README item into the same
package that references it from other files. What is beoding done with
sed and grep is *really* hard to understand.

I think these is what I am doing.

Any more comments? if not, I can update the description of this patch

to make things more clear.

Thanks

//Changqing



Alex

On Tue, 27 Feb 2024 at 06:11, Changqing Li
<changqing...@eng.windriver.com>  wrote:
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 (#196321): 
https://lists.openembedded.org/g/openembedded-core/message/196321
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