summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/image.bbclass6
-rw-r--r--meta/lib/oe/rootfs.py23
2 files changed, 10 insertions, 19 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 62ff07e2e7..894ff993cc 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -33,6 +33,10 @@ IMAGE_GEN_DEBUGFS ?= "0"
33# rootfs bootstrap install 33# rootfs bootstrap install
34ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" 34ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
35 35
36# These packages will be removed from a read-only rootfs after all other
37# packages have been installed
38ROOTFS_RO_UNNEEDED = "update-rc.d base-passwd shadow ${VIRTUAL-RUNTIME_update-alternatives} ${ROOTFS_BOOTSTRAP_INSTALL}"
39
36# packages to install from features 40# packages to install from features
37FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" 41FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
38FEATURE_INSTALL[vardepvalue] = "${FEATURE_INSTALL}" 42FEATURE_INSTALL[vardepvalue] = "${FEATURE_INSTALL}"
@@ -114,7 +118,7 @@ def rootfs_variables(d):
114 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS', 118 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS',
115 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS', 119 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS',
116 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS', 120 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS',
117 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS'] 121 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED']
118 variables.extend(rootfs_command_variables(d)) 122 variables.extend(rootfs_command_variables(d))
119 variables.extend(variable_depends(d)) 123 variables.extend(variable_depends(d))
120 return " ".join(variables) 124 return " ".join(variables)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 0f835d311b..bfae1d8e89 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -238,28 +238,13 @@ class Rootfs(object):
238 self.d.getVar('IMAGE_ROOTFS', True), 238 self.d.getVar('IMAGE_ROOTFS', True),
239 "run-postinsts", "remove"]) 239 "run-postinsts", "remove"])
240 240
241 runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management",
242 True, False, self.d)
243 sysvcompat_in_distro = bb.utils.contains("DISTRO_FEATURES", [ "systemd", "sysvinit" ],
244 True, False, self.d)
245 image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", 241 image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
246 True, False, self.d) 242 True, False, self.d)
247 if sysvcompat_in_distro and not image_rorfs:
248 pkg_to_remove = ""
249 else:
250 pkg_to_remove = "update-rc.d"
251 if image_rorfs: 243 if image_rorfs:
252 # Remove components that we don't need if it's a read-only rootfs 244 # Remove components that we don't need if it's a read-only rootfs
245 unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED", True).split()
253 pkgs_installed = image_list_installed_packages(self.d) 246 pkgs_installed = image_list_installed_packages(self.d)
254 pkgs_to_remove = list() 247 pkgs_to_remove = [pkg for pkg in pkgs_installed if pkg in unneeded_pkgs]
255 for pkg in pkgs_installed:
256 if pkg in ["update-rc.d",
257 "base-passwd",
258 "shadow",
259 "update-alternatives", pkg_to_remove,
260 self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
261 ]:
262 pkgs_to_remove.append(pkg)
263 248
264 if len(pkgs_to_remove) > 0: 249 if len(pkgs_to_remove) > 0:
265 self.pm.remove(pkgs_to_remove, False) 250 self.pm.remove(pkgs_to_remove, False)
@@ -273,6 +258,8 @@ class Rootfs(object):
273 post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True) 258 post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True)
274 execute_pre_post_process(self.d, post_uninstall_cmds) 259 execute_pre_post_process(self.d, post_uninstall_cmds)
275 260
261 runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management",
262 True, False, self.d)
276 if not runtime_pkgmanage: 263 if not runtime_pkgmanage:
277 # Remove the package manager data files 264 # Remove the package manager data files
278 self.pm.remove_packaging_data() 265 self.pm.remove_packaging_data()