[OE-core] [PATCH 1/3] tar-replacement-native: avoid race condition with host tar

Patrick Ohly patrick.ohly at intel.com
Tue Aug 11 08:44:58 UTC 2015


Installing "tar" into the sysroot leads to race conditions
(tasks which do not depend on tar-replacement-native may already
call tar while it's installation is incomplete). Avoid those
by installing only the tar binary under the name tar-native.

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
---
 meta/recipes-extended/tar/tar-replacement-native_1.28.bb | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-extended/tar/tar-replacement-native_1.28.bb b/meta/recipes-extended/tar/tar-replacement-native_1.28.bb
index 071ede7..d69122f 100644
--- a/meta/recipes-extended/tar/tar-replacement-native_1.28.bb
+++ b/meta/recipes-extended/tar/tar-replacement-native_1.28.bb
@@ -3,4 +3,16 @@ require tar_${PV}.bb
 inherit native
 
 BPN = "tar"
-EXTRAINSTALL = ""
+
+# Installing "tar" into the sysroot leads to race conditions
+# (tasks which do not depend on tar-replacement-native may already
+# call tar while it's installation is incomplete). Avoid those
+# by installing only the tar binary under the name tar-native.
+EXTRAINSTALL = "do_install_extra_native"
+do_install_extra_native () {
+    remove=$(ls -d ${D}/*)
+    mv ${D}${bindir}/tar ${D}/tar-native
+    rm -r $remove
+    install -d ${D}${bindir}
+    mv ${D}/tar-native ${D}${bindir}
+}
-- 
2.1.4




More information about the Openembedded-core mailing list