Skip to contentSkip to conversation

rootfs_ipk: allow do_populate_sdk in parallel to do_rootfs

PATCH In review Michael Ho 2 participants 2 messages Jan 11, 2021 – Jan 12, 2021

lore
Share & tools
lore

Michael Ho

author
#0 lore raw

PATCH 1/1 rootfs_ipk: allow do_populate_sdk in parallel to do_rootfs

From: Michael Ho <[email protected]>

Switch do_populate_sdk for the ipk package manager to use a separate target opkg config file and separate the lockfiles restricting do_rootfs and do_populate_sdk from running in parallel.

This way if an image recipe includes a dependency to do_populate_sdk by default then it will run in parallel to do_rootfs saving time compared to the sequential execution.

---
 meta/classes/package_ipk.bbclass | 1 +
 meta/classes/rootfs_ipk.bbclass  | 4 ++--
 meta/lib/oe/sdk.py               | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
meta/classes/package_ipk.bbclass +1 -0
index c008559..54da32e 100644
@@ -4,6 +4,7 @@ IMAGE_PKGTYPE ?= "ipk"
 
 IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
 IPKGCONF_SDK =  "${WORKDIR}/opkg-sdk.conf"
+IPKGCONF_SDK_TARGET = "${WORKDIR}/opkg-sdk-target.conf"
 
 PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
 
meta/classes/rootfs_ipk.bbclass +2 -2
index f1e0219..245c256 100644
@@ -14,8 +14,8 @@ do_rootfs[recrdeptask] += "do_package_write_ipk do_package_qa"
 do_rootfs[vardeps] += "PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS"
 
 do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
-do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
-do_populate_sdk_ext[lockfiles] += "${WORKDIR}/ipk.lock"
+do_populate_sdk[lockfiles] += "${WORKDIR}/sdk-ipk.lock"
+do_populate_sdk_ext[lockfiles] += "${WORKDIR}/sdk-ipk.lock"
 
 OPKG_PREPROCESS_COMMANDS = ""
 
meta/lib/oe/sdk.py +2 -2
index d02a274..3d6141b 100644
@@ -219,7 +219,7 @@ class OpkgSdk(Sdk):
     def __init__(self, d, manifest_dir=None):
         super(OpkgSdk, self).__init__(d, manifest_dir)
 
-        self.target_conf = self.d.getVar("IPKGCONF_TARGET")
+        self.target_conf = self.d.getVar("IPKGCONF_SDK_TARGET")
         self.host_conf = self.d.getVar("IPKGCONF_SDK")
 
         self.target_manifest = OpkgManifest(d, self.manifest_dir,
@@ -400,7 +400,7 @@ def sdk_list_installed_packages(d, target, rootfs_dir=None):
         os_var = ["SDK_OS", None][target is True]
         return RpmPkgsList(d, rootfs_dir).list_pkgs()
     elif img_type == "ipk":
-        conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_TARGET"][target is True]
+        conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_SDK_TARGET"][target is True]
         return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var)).list_pkgs()
     elif img_type == "deb":
         return DpkgPkgsList(d, rootfs_dir).list_pkgs()
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · Michael Ho

From: Michael Ho <[email protected]>

Switch do_populate_sdk for the ipk package manager to use a separate target opkg config file and separate the lockfiles restricting do_rootfs and do_populate_sdk from running in parallel.

This way if an image recipe includes a dependency to do_populate_sdk by default then it will run in parallel to do_rootfs saving time compared to the sequential execution.

Quoted 6 lines

---

 meta/classes/package_ipk.bbclass | 1 +
 meta/classes/rootfs_ipk.bbclass  | 4 ++--
 meta/lib/oe/sdk.py               | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

Personally, I don't think this is a potentially problematic backport candidate as we don't even know it works in master and it exposes dunfell to lots of potential races...

Cheers,

Richard