From c4c574dff9ef689c7694a6055907083e7a018d48 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 6 Sep 2015 15:08:15 +0000 Subject: [PATCH] rootfs: Conditionally uninstall update-rc.d update-rc.d is now needed by systemd to interact with sysv scripts, so if we have a mixed system, then we can not uninstall update-rc.d as it is going to break systemd functionality, we check for sysvinit and sytemd in distro and also ensure that its not building an image with readonly rootfs Signed-off-by: Khem Raj --- meta/lib/oe/rootfs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index c29843b054fa..639d642d9139 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -228,6 +228,14 @@ def _uninstall_unneeded(self): runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management", True, False, self.d) + sysvcompat_in_distro = bb.utils.contains("DISTRO_FEATURES", [ "systemd", "sysvinit" ], + True, False, self.d) + image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", + True, False, self.d) + if sysvcompat_in_distro and not image_rorfs: + pkg_to_remove = "" + else: + pkg_to_remove = "update-rc.d" if not runtime_pkgmanage: # Remove components that we don't need if we're not going to install # additional packages at runtime @@ -238,10 +246,9 @@ def _uninstall_unneeded(self): pkgs_installed = installed_pkgs.read().splitlines() for pkg_installed in pkgs_installed[:]: pkg = pkg_installed.split()[0] - if pkg in ["update-rc.d", - "base-passwd", + if pkg in ["base-passwd", "shadow", - "update-alternatives", + "update-alternatives", pkg_to_remove, self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) ]: pkgs_to_remove.append(pkg)