systemd: Check for directory before chmod'ing it

da9db878a1 systemd: fix dead link /var/log/README
add -Dcreate-log-dirs=false which means journal dir
will not be generated regardless of VOLATILE_LOG_DIR value
if a distro decided to set VOLATILE_LOG_DIR=no this
code path will be executes and the directory being operated
upon wont exist ending in do_install errors

chown: cannot access '/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/systemd/255.4/image/var/log/journal': No such file or directory

(From OE-Core rev: e017f405bf6ae6c269a8c9c981878fd1ad8666b6)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2024-03-07 11:10:36 -08:00
committed by Richard Purdie
parent 045eb59130
commit e8384ba2fa

View File

@@ -306,7 +306,7 @@ do_install() {
# /var/log is typically a symbolic link to inside /var/volatile,
# which is expected to be empty.
rm -rf ${D}${localstatedir}/log
else
elif [ -e ${D}${localstatedir}/log/journal ]; then
chown root:systemd-journal ${D}${localstatedir}/log/journal
# journal-remote creates this at start