rootfs-postcommands.bbclass: add post func remove_unused_dnf_log_lock

Remove log_lock.pid which maybe created during do_rootfs. In commit
[dnf: only write the log lock to root for native dnf],
native dnf changed to write log lock to root, and target dnf still
use /var/log, so log_lock.pid need to be removed post do_rootfs.

(From OE-Core rev: 595fbe4c9ad25e52e88d7bcf1d1864fe5ec324a5)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Changqing Li
2023-06-30 16:32:21 +08:00
committed by Steve Sakoman
parent e7242a885b
commit d069c8743f

View File

@@ -49,6 +49,8 @@ ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check; overlayfs_postprocess;", "", d)}'
ROOTFS_POSTPROCESS_COMMAND += 'remove_unused_dnf_log_lock;'
inherit image-artifact-names
# Sort the user and group entries in /etc by ID in order to make the content
@@ -276,6 +278,11 @@ empty_var_volatile () {
fi
}
remove_unused_dnf_log_lock() {
if [ -e ${IMAGE_ROOTFS}/log_lock.pid ]; then
rm -rf ${IMAGE_ROOTFS}/log_lock.pid
fi
}
# Turn any symbolic /sbin/init link into a file
remove_init_link () {
if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then