All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: openembedded-core@lists.openembedded.org,
	alexander.kanavin@linux.intel.com
Cc: Stefan Agner <stefan.agner@toradex.com>
Subject: [PATCH v2 3/3] rootfs.py: for dpkg/opkg, don't install postinsts if package management is present
Date: Wed, 16 May 2018 11:13:52 +0200	[thread overview]
Message-ID: <20180516091352.29279-4-stefan@agner.ch> (raw)
In-Reply-To: <20180516091352.29279-1-stefan@agner.ch>

From: Stefan Agner <stefan.agner@toradex.com>

If package management is present opkg/dpkg will bring the original
copy of the postinsts scripts with the metadata and will be able to
handle postinsts just fine. In fact, it is preferred to let package
management handle the postinsts scripts in this case since it will
keep the package managers database up-to-date too. The run-postinsts
scripts will make sure the package manager gets invoked instead of
the scripts directly.

Note: Before commit 5aae19959a44 ("rootfs.py: Change logic to
unistall packages") rootfs.py did not install /etc/$pm-postinsts
too. It is not clear whether that change was intentionally or just
a bug. This commit fixes/reverts that aspect of the commit.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
---
 meta/lib/oe/rootfs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index f8f717c050..0a57d87f71 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -560,6 +560,9 @@ class DpkgOpkgRootfs(Rootfs):
         return pkg_list
 
     def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+        if bb.utils.contains("IMAGE_FEATURES", "package-management",
+                         True, False, self.d):
+            return
         num = 0
         for p in self._get_delayed_postinsts():
             bb.utils.mkdirhier(dst_postinst_dir)
-- 
2.13.6



  parent reply	other threads:[~2018-05-16  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  9:13 [PATCH v2 0/3] postinst fixes for opgk/dpkg Stefan Agner
2018-05-16  9:13 ` [PATCH v2 1/3] opkg: avoid running postinst scripts twice when using systemd Stefan Agner
2018-05-16  9:13 ` [PATCH v2 2/3] run-postinsts: for dpkg/opkg, do not rely on /etc/*-postinsts Stefan Agner
2018-05-16  9:13 ` Stefan Agner [this message]
2018-06-04 16:06 ` [PATCH v2 0/3] postinst fixes for opgk/dpkg Stefan Agner
2018-06-04 16:18   ` Alexander Kanavin
2018-06-14 13:57     ` Stefan Agner
2018-06-14 19:08       ` Alexander Kanavin

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=20180516091352.29279-4-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=alexander.kanavin@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefan.agner@toradex.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 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.