* [PATCHv2] Do not clobber policy-rc.d if it already exists
@ 2019-09-11 8:43 Dalamagkidis, Konstantinos
2019-10-07 10:11 ` Baurzhan Ismagulov
0 siblings, 1 reply; 2+ messages in thread
From: Dalamagkidis, Konstantinos @ 2019-09-11 8:43 UTC (permalink / raw)
To: isar-users; +Cc: Dalamagkidis, Konstantinos
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-07 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 8:43 [PATCHv2] Do not clobber policy-rc.d if it already exists Dalamagkidis, Konstantinos
2019-10-07 10:11 ` Baurzhan Ismagulov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox