Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv3 1/3] systemd: Do not install anything in /var/volatile
@ 2021-10-29 21:29 Peter Kjellerstedt
  2021-10-29 21:29 ` [PATCHv3 2/3] base-files: Ignore the empty-dirs QA error due to files " Peter Kjellerstedt
  2021-10-29 21:29 ` [PATCHv3 3/3] insane.bbclass: Add a check for directories that are expected to be empty Peter Kjellerstedt
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Kjellerstedt @ 2021-10-29 21:29 UTC (permalink / raw)
  To: openembedded-core

/var/log is typically a symbolic link to inside /var/volatile, which
is expected to be empty. Check ${VOLATILE_LOG_DIR} to see if it is ok
to install /var/log.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: Added check for ${VOLATILE_LOG_DIR} before removing /var/log.
PATCHv3: No changes.

 meta/recipes-core/systemd/systemd_249.5.bb | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_249.5.bb b/meta/recipes-core/systemd/systemd_249.5.bb
index d87f54bf16..c0c1f9bcfc 100644
--- a/meta/recipes-core/systemd/systemd_249.5.bb
+++ b/meta/recipes-core/systemd/systemd_249.5.bb
@@ -270,13 +270,16 @@ do_install() {
 		install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_system_unitdir}d-sysv-install
 	fi
 
-	chown root:systemd-journal ${D}/${localstatedir}/log/journal
-
-	# Delete journal README, as log can be symlinked inside volatile.
-	rm -f ${D}/${localstatedir}/log/README
+	if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then
+		# /var/log is typically a symbolic link to inside /var/volatile,
+		# which is expected to be empty.
+		rm -rf ${D}${localstatedir}/log
+	else
+		chown root:systemd-journal ${D}${localstatedir}/log/journal
 
-	# journal-remote creates this at start
-	rm -rf ${D}/${localstatedir}/log/journal/remote
+		# journal-remote creates this at start
+		rm -rf ${D}${localstatedir}/log/journal/remote
+	fi
 
 	install -d ${D}${systemd_system_unitdir}/graphical.target.wants
 	install -d ${D}${systemd_system_unitdir}/multi-user.target.wants


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-04  5:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-29 21:29 [PATCHv3 1/3] systemd: Do not install anything in /var/volatile Peter Kjellerstedt
2021-10-29 21:29 ` [PATCHv3 2/3] base-files: Ignore the empty-dirs QA error due to files " Peter Kjellerstedt
2021-10-29 21:29 ` [PATCHv3 3/3] insane.bbclass: Add a check for directories that are expected to be empty Peter Kjellerstedt
2021-10-31 15:53   ` [OE-core] " Richard Purdie
2021-11-01  1:00     ` Khem Raj
2021-11-02 18:55       ` Peter Kjellerstedt
2021-11-04  5:09         ` Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox