]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base/image: Fix races for variable mappings
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Mar 2013 17:43:41 +0000 (17:43 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Mar 2013 12:29:46 +0000 (12:29 +0000)
When using the -c populate_sdk option, images are not generated quite as
they should be under certain circumstances. For example the dropbear
feature may not get replaced with openssh, leading to both being installed
with an appropriate rootfs failure.

This patch moves the remapping logic to later points in the code, ensuring
there is no conflict. The result is slightly simpler too as an added bonus.

[YOCTO #3749]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image.bbclass
meta/classes/populate_sdk_base.bbclass

index 19564d81b63920b1e153915a1f4d5f60b8dbe621..68bd342d612e34c12c28aa04d9df8659e1fc6e42 100644 (file)
@@ -117,6 +117,10 @@ python () {
 
     d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features)))
 
+    if d.getVar('BB_WORKERCONTEXT', True) is not None:
+        runtime_mapping_rename("PACKAGE_INSTALL", d)
+        runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", d)
+
     # Ensure we have the vendor list for complementary package handling
     ml_vendor_list = ""
     multilibs = d.getVar('MULTILIBS', True) or ""
@@ -129,19 +133,6 @@ python () {
     d.setVar('MULTILIB_VENDORS', ml_vendor_list)
 }
 
-python image_handler () {
-    if not isinstance(e, bb.event.RecipeParsed):
-        return
-
-    # If we don't do this we try and run the mapping hooks while parsing which is slow
-    # bitbake should really provide something to let us know this...
-    if e.data.getVar('BB_WORKERCONTEXT', True) is not None:
-        runtime_mapping_rename("PACKAGE_INSTALL", e.data)
-        runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", e.data)
-
-}
-addhandler image_handler
-
 #
 # Get a list of files containing device tables to create.
 # * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
index 88de1e48ac27b74c3ca9ac1cf3d271fc2f5d9396..7af2d2e9e219dbcac418b654e4fe03a9053f7b26 100644 (file)
@@ -29,14 +29,9 @@ EXCLUDE_FROM_WORLD = "1"
 
 SDK_PACKAGING_FUNC ?= "create_shar"
 
-python () {
-    # If we don't do this we try and run the mapping hooks while parsing which is slow
-    # bitbake should really provide something to let us know this...
-    if bb.data.getVar('BB_WORKERCONTEXT', d, True) is not None:
-        runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d)
-}
-
 fakeroot python do_populate_sdk() {
+    runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d)
+
     bb.build.exec_func("populate_sdk_image", d)
 
     # Handle multilibs in the SDK environment, siteconfig, etc files...