Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Chen Qi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 3/4] initscripts: support persistent /var/log
Date: Wed, 16 Aug 2017 19:57:17 +0800	[thread overview]
Message-ID: <dca9f0c58dd4da6c14feecf0e8167dfdfe1a45a5.1502884438.git.Qi.Chen@windriver.com> (raw)
In-Reply-To: <cover.1502884438.git.Qi.Chen@windriver.com>

Respect VOLATILE_VAR_LOG variable so that if it's set to any valid boolean
false value, we could have persistent /var/log on the final image.

[YOCTO #6132]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/volatiles | 1 -
 meta/recipes-core/initscripts/initscripts_1.0.bb        | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index bc17c45..2011066 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -27,7 +27,6 @@ d root root 1777 /run/lock none
 d root root 0755 /var/volatile/log none
 d root root 1777 /var/volatile/tmp none
 l root root 1777 /var/lock /run/lock
-l root root 0755 /var/log /var/volatile/log
 l root root 0755 /var/run /run
 l root root 1777 /var/tmp /var/volatile/tmp
 l root root 1777 /tmp /var/tmp
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index a65f1b2..7ab0d2b 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -102,6 +102,9 @@ do_install () {
 	install -m 0755    ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/save-rtc.sh	${D}${sysconfdir}/init.d
 	install -m 0644    ${WORKDIR}/volatiles		${D}${sysconfdir}/default/volatiles/00_core
+	if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
+		echo "l root root 0755 /var/log /var/volatile/log" >> ${D}${sysconfdir}/default/volatiles/00_core
+	fi
 	install -m 0755    ${WORKDIR}/dmesg.sh		${D}${sysconfdir}/init.d
 	install -m 0644    ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
 
-- 
1.9.1



  parent reply	other threads:[~2017-08-16 11:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 11:57 [PATCH V4 0/4] Persistent /var/log support Chen Qi
2017-08-16 11:57 ` [PATCH 1/4] bitbake.conf: add VOLATILE_LOG_DIR variable Chen Qi
2017-08-16 11:57 ` [PATCH 2/4] base-files: respect VOLATILE_LOG_DIR Chen Qi
2017-08-16 11:57 ` Chen Qi [this message]
2017-08-16 11:57 ` [PATCH 4/4] package.bbclass: support persistent /var/log Chen Qi
  -- strict thread matches above, loose matches on Subject: below --
2016-11-22 10:10 [PATCH 0/4] Persistent /var/log support Chen Qi
2016-11-22 10:10 ` [PATCH 3/4] initscripts: support persistent /var/log Chen Qi
2016-12-12  8:05   ` Patrick Ohly
2016-12-13  8:00     ` ChenQi
2015-03-24  8:42 [PATCH 0/4] Support " Chen Qi
2015-03-24  8:42 ` [PATCH 3/4] initscripts: support " Chen Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dca9f0c58dd4da6c14feecf0e8167dfdfe1a45a5.1502884438.git.Qi.Chen@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox