From 25477874ef737777cedc623a8e1c5aedf2f4bae1 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 27 Jan 2016 15:14:26 -0800 Subject: lib/oe/package_manager: remove package feed lists Remove opkg package feed lists after generating the rootfs. The lists have been generated by the local feed but are no longer necessary after image generation. This still leaves the package management fully usable (and hence is different from omitting package-management from IMAGE_FEATURES). Signed-off-by: Stefan Agner Signed-off-by: Richard Purdie --- meta/lib/oe/package_manager.py | 11 ++++++++--- meta/lib/oe/rootfs.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'meta') diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 3f9e4e3b60..5776952523 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -1432,10 +1432,11 @@ class OpkgPM(PackageManager): if not os.path.exists(self.d.expand('${T}/saved')): bb.utils.mkdirhier(self.d.expand('${T}/saved')) - if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1": - self._create_config() - else: + self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") == "1" + if self.from_feeds: self._create_custom_config() + else: + self._create_config() self.indexer = OpkgIndexer(self.d, self.deploy_dir) @@ -1638,6 +1639,10 @@ class OpkgPM(PackageManager): # create the directory back, it's needed by PM lock bb.utils.mkdirhier(self.opkg_dir) + def remove_lists(self): + if not self.from_feeds: + bb.utils.remove(os.path.join(self.opkg_dir, "lists"), True) + def list_installed(self): return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs() diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 0e901c2405..0f835d311b 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -949,7 +949,7 @@ class OpkgRootfs(DpkgOpkgRootfs): self._log_check_error() def _cleanup(self): - pass + self.pm.remove_lists() def get_class_for_type(imgtype): return {"rpm": RpmRootfs, -- cgit v1.2.3