Skip to contentSkip to conversation

scripts/wipe-sysroot: also delete uninative sysroot

PATCH New Ross Burton 1 participant 3 messages Jan 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 scripts/wipe-sysroot: also delete uninative sysroot

The uninative sysroot is in ${STAGING_DIR}-uninative so delete that alongwith $STAGING_DIR.

---
 scripts/wipe-sysroot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/wipe-sysroot +1 -1
index c22d39a..9e067e8 100755
@@ -42,7 +42,7 @@ fi
 echo "Deleting the sysroots in $STAGING_DIR, and selected stamps in $SSTATE_MANIFESTS and $STAMPS_DIR."
 
 # The sysroots themselves
-rm -rf $STAGING_DIR
+rm -rf $STAGING_DIR ${STAGING_DIR}-uninative
 
 # The stamps that said the sysroot was populated
 rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
Signature · 1 line
2.6.4
#1 lore raw

PATCH 2/3 uninative: fix path to patchelf-uninative

When uninative was changed to use it's own sysroot the path to patchelf lost ${bindir_native}, so add it back.

---
 meta/classes/uninative.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/uninative.bbclass +1 -1
index 8686159..3383e01 100644
@@ -42,7 +42,7 @@ python uninative_eventhandler() {
             except Exception as exc:
                 bb.fatal("Unable to download uninative tarball: %s" % str(exc))
 
-        cmd = e.data.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/patchelf-uninative")
+        cmd = e.data.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative")
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as exc:
Signature · 1 line
2.6.4
#2 lore raw

PATCH 3/3 uninative: handle UNINATIVE_URL being file:///

In reply to Ross Burton

If the local fetcher is used then files are not actually fetched into DL_DIR, so check if this happened and if required add a symlink to the real file.

---
 meta/classes/uninative.bbclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
meta/classes/uninative.bbclass +8 -4
index 3383e01..38c05df 100644
@@ -16,11 +16,13 @@ python uninative_eventhandler() {
     loader = e.data.getVar("UNINATIVE_LOADER", True)
     tarball = d.getVar("UNINATIVE_TARBALL", True)
     tarballdir = d.getVar("UNINATIVE_DLDIR", True)
+    tarballpath = os.path.join(tarballdir, tarball)
+
     if not os.path.exists(loader):
         import subprocess
 
         olddir = os.getcwd()
-        if not os.path.exists(os.path.join(tarballdir, tarball)):
+        if not os.path.exists(tarballpath):
             # Copy the data object and override DL_DIR and SRC_URI
             localdata = bb.data.createCopy(d)
 
@@ -32,13 +34,15 @@ python uninative_eventhandler() {
                 bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True))
 
             srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};md5sum=%s" % chksum)
-            dldir = localdata.expand(tarballdir)
-            localdata.setVar('FILESPATH', dldir)
-            localdata.setVar('DL_DIR', dldir)
+            localdata.setVar('FILESPATH', tarballdir)
+            localdata.setVar('DL_DIR', tarballdir)
             bb.note("Fetching uninative binary shim from %s" % srcuri)
             fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
             try:
                 fetcher.download()
+                localpath = fetcher.localpath(srcuri)
+                if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
+                    os.symlink(localpath, tarballpath)
             except Exception as exc:
                 bb.fatal("Unable to download uninative tarball: %s" % str(exc))
 
Signature · 1 line
2.6.4