From: "Dalamagkidis, Konstantinos" <konstantinos.dalamagkidis@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Dalamagkidis, Konstantinos" <konstantinos.dalamagkidis@siemens.com>
Subject: [PATCHv2] Do not clobber policy-rc.d if it already exists
Date: Wed, 11 Sep 2019 08:43:15 +0000 [thread overview]
Message-ID: <20190911084230.19868-1-konstantinos.dalamagkidis@siemens.com> (raw)
We had the problem that our policy-rc.d was removed by the chroot-setup
script. This proposed patch uses the mechanism used for the
start-stop-daemon.
Signed-off-by: Konstantinos Dalamagkidis <konstantinos.dalamagkidis@siemens.com>
---
meta/recipes-core/isar-bootstrap/files/chroot-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh b/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh
index f84f63a..4150011 100644
--- a/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh
+++ b/meta/recipes-core/isar-bootstrap/files/chroot-setup.sh
@@ -78,6 +78,9 @@ chroot_setup() {
# Create a policy-rc.d to stop maintainer scripts using invoke-rc.d
# from running init scripts. In case of maintainer scripts that do not
# use invoke-rc.d, add a dummy start-stop-daemon.
+ if [ -e "/${TARGET}/sbin/policy-rc.d" ]; then
+ divert "${TARGET}" /sbin/policy-rc.d
+ fi
cat > "/${TARGET}/usr/sbin/policy-rc.d" <<-EOF
#!/bin/sh
exit 101
@@ -114,7 +117,7 @@ chroot_cleanup() {
check_target "${TARGET}" || return 1
- rm -f "/${TARGET}/usr/sbin/policy-rc.d"
+ undivert "${TARGET}" /usr/sbin/policy-rc.d
undivert "${TARGET}" /sbin/start-stop-daemon
if [ -x "/${TARGET}/sbin/initctl.REAL" ]; then
undivert "${TARGET}" /sbin/initctl
--
2.20.1
next reply other threads:[~2019-09-11 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 8:43 Dalamagkidis, Konstantinos [this message]
2019-10-07 10:11 ` Baurzhan Ismagulov
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=20190911084230.19868-1-konstantinos.dalamagkidis@siemens.com \
--to=konstantinos.dalamagkidis@siemens.com \
--cc=isar-users@googlegroups.com \
/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