All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthias Schiffer" <matthias.schiffer@ew.tq-group.com>
To: openembedded-core@lists.openembedded.org
Cc: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Subject: [PATCH 3/3] initscripts: fix creation order for /var/log with VOLATILE_LOG_DIR=true
Date: Wed, 21 Jul 2021 16:10:16 +0200	[thread overview]
Message-ID: <f41298a4ab1593f5fd3e9d24d9960196ab4006f0.1626875447.git.matthias.schiffer@ew.tq-group.com> (raw)
In-Reply-To: <0fb2381b97f71a3469e6c5a0de98b2c3e7aa75c2.1626875447.git.matthias.schiffer@ew.tq-group.com>
In-Reply-To: <0fb2381b97f71a3469e6c5a0de98b2c3e7aa75c2.1626875447.git.matthias.schiffer@ew.tq-group.com>

Create the /var/log symlink directly after /var/volatile/log, so
/var/log is available for the creation of /var/log/wtmp a few lines
later.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

An alternative solution would be to move the creation of the /var/log
link (and possibly /var/volatile/log itself) to a separate volatile list
that is applied before 00_core. This would simplify the code and improve
compatiblity with patch [1] (currently applied downstream by
WindRiver Linux, I'm not sure what the status is regarding inclusion in
OpenEmbedded core).


[1] https://patchwork.openembedded.org/patch/176834/


 meta/recipes-core/initscripts/initscripts_1.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 5e994f2b7f..65f9c0ae8d 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -106,7 +106,8 @@ do_install () {
 	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
+		sed -i -e '\@^d root root 0755 /var/volatile/log none$@ a\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}/
-- 
2.17.1


      parent reply	other threads:[~2021-07-21 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 14:10 [PATCH 1/3] initscripts: populate-volatile.sh: do not log to tty0 Matthias Schiffer
2021-07-21 14:10 ` [PATCH 2/3] initscripts: populate-volatile.sh: run create_file synchronously Matthias Schiffer
2021-07-21 14:10 ` Matthias Schiffer [this message]

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=f41298a4ab1593f5fd3e9d24d9960196ab4006f0.1626875447.git.matthias.schiffer@ew.tq-group.com \
    --to=matthias.schiffer@ew.tq-group.com \
    --cc=openembedded-core@lists.openembedded.org \
    --subject='Re: [PATCH 3/3] initscripts: fix creation order for /var/log with VOLATILE_LOG_DIR=true' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.