Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Phil Blundell <philb@gnu.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2] rootfs_ipk: Avoid leaving run-postinsts around if online package management is disabled
Date: Fri, 21 Sep 2012 20:42:38 +0100	[thread overview]
Message-ID: <1348256558.4444.194.camel@x121e.pbcl.net> (raw)

If all postinsts have already been run during rootfs construction then
there's no point in having run-postinsts in the installed system.
Clean it up at the same time that update-rc.d and suchlike are being
removed.

Signed-off-by: Phil Blundell <pb@pbcl.net>
---
v2: per suggestion from Paul Eggleton, don't refer to O_P_M in subject 
line since oe-core doesn't use it anymore

 meta/classes/rootfs_ipk.bbclass |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 6cdd8f6..46e8d60 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -97,8 +97,18 @@ fakeroot rootfs_ipk_do_rootfs () {
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
 		if ! grep Status:.install.ok.unpacked ${STATUS}; then
 			# All packages were successfully configured.
-			# update-rc.d, base-passwd are no further use, remove them now
-			opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd || true
+			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now
+			remove_run_postinsts=false
+			if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
+				remove_run_postinsts=true
+			fi
+			opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} || true
+
+			# Need to remove rc.d files for run-postinsts by hand since opkg won't
+			# call postrm scripts in offline root mode.
+			if $remove_run_postinsts; then
+				update-rc.d -f -r ${IMAGE_ROOTFS} run-postinsts remove
+			fi
 
 			# Also delete the status files
 			rm -rf ${IMAGE_ROOTFS}${opkglibdir}
-- 
1.7.9







             reply	other threads:[~2012-09-21 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 19:42 Phil Blundell [this message]
2012-09-24 10:27 ` [PATCH v2] rootfs_ipk: Avoid leaving run-postinsts around if online package management is disabled Richard Purdie

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=1348256558.4444.194.camel@x121e.pbcl.net \
    --to=philb@gnu.org \
    --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