summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-14 15:18:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:44:33 +0100
commit26a786f86989ce47eac4eecec3b0798730194b05 (patch)
tree263638168e588d8c06f476d9d238e261c13fc294 /meta
parentad6b73702934c0bb10afe66e13936d1313782352 (diff)
downloadpoky-26a786f86989ce47eac4eecec3b0798730194b05.tar.gz
package_manager/sdk: Use filtered copies of the deploy ipk/deb directories
Similar to rpm, use copies of the ipk/deb directories for rootfs construction. This means the image creation code can no longer "see" recipes wich aren't in its dependency chain which is good for a variety of reasons including determinism, incompatible recipe (e.g. systemd/sysvinit) package conflicts and locking performance. (From OE-Core rev: c7c5f4065c102fde4e11d138fb0b6e25bffe0379) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py14
-rw-r--r--meta/lib/oe/rootfs.py2
-rw-r--r--meta/lib/oe/sdk.py20
-rw-r--r--meta/lib/oeqa/utils/package_manager.py6
4 files changed, 31 insertions, 11 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index f1dbe48a72..06d1f09d9f 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1124,19 +1124,22 @@ class OpkgDpkgPM(PackageManager):
1124 self.mark_packages("unpacked", registered_pkgs.split()) 1124 self.mark_packages("unpacked", registered_pkgs.split())
1125 1125
1126class OpkgPM(OpkgDpkgPM): 1126class OpkgPM(OpkgDpkgPM):
1127 def __init__(self, d, target_rootfs, config_file, archs, task_name='target'): 1127 def __init__(self, d, target_rootfs, config_file, archs, task_name='target', ipk_repo_workdir="oe-rootfs-repo", filterbydependencies=True, prepare_index=True):
1128 super(OpkgPM, self).__init__(d, target_rootfs) 1128 super(OpkgPM, self).__init__(d, target_rootfs)
1129 1129
1130 self.config_file = config_file 1130 self.config_file = config_file
1131 self.pkg_archs = archs 1131 self.pkg_archs = archs
1132 self.task_name = task_name 1132 self.task_name = task_name
1133 1133
1134 self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK") 1134 self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), ipk_repo_workdir)
1135 self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock") 1135 self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
1136 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") 1136 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
1137 self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs) 1137 self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
1138 self.opkg_args += self.d.getVar("OPKG_ARGS") 1138 self.opkg_args += self.d.getVar("OPKG_ARGS")
1139 1139
1140 if prepare_index:
1141 create_packages_dir(self.d, self.deploy_dir, d.getVar("DEPLOY_DIR_IPK"), "package_write_ipk", filterbydependencies)
1142
1140 opkg_lib_dir = self.d.getVar('OPKGLIBDIR') 1143 opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
1141 if opkg_lib_dir[0] == "/": 1144 if opkg_lib_dir[0] == "/":
1142 opkg_lib_dir = opkg_lib_dir[1:] 1145 opkg_lib_dir = opkg_lib_dir[1:]
@@ -1501,9 +1504,12 @@ class OpkgPM(OpkgDpkgPM):
1501 return tmp_dir 1504 return tmp_dir
1502 1505
1503class DpkgPM(OpkgDpkgPM): 1506class DpkgPM(OpkgDpkgPM):
1504 def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None): 1507 def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None, deb_repo_workdir="oe-rootfs-repo", filterbydependencies=True):
1505 super(DpkgPM, self).__init__(d, target_rootfs) 1508 super(DpkgPM, self).__init__(d, target_rootfs)
1506 self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB') 1509 self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), deb_repo_workdir)
1510
1511 create_packages_dir(self.d, self.deploy_dir, d.getVar("DEPLOY_DIR_DEB"), "package_write_deb", filterbydependencies)
1512
1507 if apt_conf_dir is None: 1513 if apt_conf_dir is None:
1508 self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt") 1514 self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt")
1509 else: 1515 else:
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 28642abbd9..cdb86f7715 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -786,7 +786,7 @@ class OpkgRootfs(DpkgOpkgRootfs):
786 ml_opkg_conf = os.path.join(ml_temp, 786 ml_opkg_conf = os.path.join(ml_temp,
787 variant + "-" + os.path.basename(self.opkg_conf)) 787 variant + "-" + os.path.basename(self.opkg_conf))
788 788
789 ml_pm = OpkgPM(self.d, ml_target_rootfs, ml_opkg_conf, self.pkg_archs) 789 ml_pm = OpkgPM(self.d, ml_target_rootfs, ml_opkg_conf, self.pkg_archs, prepare_index=False)
790 790
791 ml_pm.update() 791 ml_pm.update()
792 ml_pm.install(pkgs) 792 ml_pm.install(pkgs)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index f20441ccf6..153b07d76b 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -227,11 +227,17 @@ class OpkgSdk(Sdk):
227 self.host_manifest = OpkgManifest(d, self.manifest_dir, 227 self.host_manifest = OpkgManifest(d, self.manifest_dir,
228 Manifest.MANIFEST_TYPE_SDK_HOST) 228 Manifest.MANIFEST_TYPE_SDK_HOST)
229 229
230 ipk_repo_workdir = "oe-sdk-repo"
231 if "sdk_ext" in d.getVar("BB_RUNTASK"):
232 ipk_repo_workdir = "oe-sdk-ext-repo"
233
230 self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf, 234 self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
231 self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")) 235 self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
236 ipk_repo_workdir=ipk_repo_workdir)
232 237
233 self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf, 238 self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
234 self.d.getVar("SDK_PACKAGE_ARCHS")) 239 self.d.getVar("SDK_PACKAGE_ARCHS"),
240 ipk_repo_workdir=ipk_repo_workdir)
235 241
236 def _populate_sysroot(self, pm, manifest): 242 def _populate_sysroot(self, pm, manifest):
237 pkgs_to_install = manifest.parse_initial_manifest() 243 pkgs_to_install = manifest.parse_initial_manifest()
@@ -307,15 +313,21 @@ class DpkgSdk(Sdk):
307 self.host_manifest = DpkgManifest(d, self.manifest_dir, 313 self.host_manifest = DpkgManifest(d, self.manifest_dir,
308 Manifest.MANIFEST_TYPE_SDK_HOST) 314 Manifest.MANIFEST_TYPE_SDK_HOST)
309 315
316 deb_repo_workdir = "oe-sdk-repo"
317 if "sdk_ext" in d.getVar("BB_RUNTASK"):
318 deb_repo_workdir = "oe-sdk-ext-repo"
319
310 self.target_pm = DpkgPM(d, self.sdk_target_sysroot, 320 self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
311 self.d.getVar("PACKAGE_ARCHS"), 321 self.d.getVar("PACKAGE_ARCHS"),
312 self.d.getVar("DPKG_ARCH"), 322 self.d.getVar("DPKG_ARCH"),
313 self.target_conf_dir) 323 self.target_conf_dir,
324 deb_repo_workdir=deb_repo_workdir)
314 325
315 self.host_pm = DpkgPM(d, self.sdk_host_sysroot, 326 self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
316 self.d.getVar("SDK_PACKAGE_ARCHS"), 327 self.d.getVar("SDK_PACKAGE_ARCHS"),
317 self.d.getVar("DEB_SDK_ARCH"), 328 self.d.getVar("DEB_SDK_ARCH"),
318 self.host_conf_dir) 329 self.host_conf_dir,
330 deb_repo_workdir=deb_repo_workdir)
319 331
320 def _copy_apt_dir_to(self, dst_dir): 332 def _copy_apt_dir_to(self, dst_dir):
321 staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE") 333 staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
diff --git a/meta/lib/oeqa/utils/package_manager.py b/meta/lib/oeqa/utils/package_manager.py
index afd5b8e75f..1495f87321 100644
--- a/meta/lib/oeqa/utils/package_manager.py
+++ b/meta/lib/oeqa/utils/package_manager.py
@@ -22,13 +22,15 @@ def get_package_manager(d, root_path):
22 pm = OpkgPM(d, 22 pm = OpkgPM(d,
23 root_path, 23 root_path,
24 d.getVar("IPKGCONF_TARGET"), 24 d.getVar("IPKGCONF_TARGET"),
25 d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")) 25 d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
26 filterbydependencies=False)
26 27
27 elif pkg_class == "deb": 28 elif pkg_class == "deb":
28 pm = DpkgPM(d, 29 pm = DpkgPM(d,
29 root_path, 30 root_path,
30 d.getVar('PACKAGE_ARCHS'), 31 d.getVar('PACKAGE_ARCHS'),
31 d.getVar('DPKG_ARCH')) 32 d.getVar('DPKG_ARCH'),
33 filterbydependencies=False)
32 34
33 pm.write_index() 35 pm.write_index()
34 pm.update() 36 pm.update()