summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-05-25 12:16:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-25 17:38:36 +0100
commit00966fd90d8c79a1cac80224b106da813f68f317 (patch)
tree06bcf9da76e87d985ad90692b46ebdadbf462791 /meta/classes
parente7f948f28a56483cf6d1e4a9afda98a373869c15 (diff)
downloadpoky-00966fd90d8c79a1cac80224b106da813f68f317.tar.gz
insane: remove broken unsafe-references-in-binaries test
This test aims to detect binaries in /bin which link to libraries in /usr/lib, for the case where the user has /usr on a separate filesystem to /. However it doesn't scan both image/ and the sysroot, so if a binary in /bin links to a library in /usr/lib that was built by the same recipe then it will error out. This test isn't enabled by default, and because of this serious bug I suspect nobody else is enabling it either. As /usr being on a separate partition to / is a very rare configuration these days I think we should delete the test: if someone cares sufficiently they should write a test that actually works. (From OE-Core rev: a6af5bbf3dad6f0951c67a0aae13ef86a8906893) (From OE-Core rev: 2f5b5685f75fc63489b628b540fcdd4c7cb27096) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass41
1 files changed, 0 insertions, 41 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 5ddb87b3f7..e541c72c2d 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -405,47 +405,6 @@ def package_qa_check_perm(path,name,d, elf, messages):
405 """ 405 """
406 return 406 return
407 407
408QAPATHTEST[unsafe-references-in-binaries] = "package_qa_check_unsafe_references_in_binaries"
409def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages):
410 """
411 Ensure binaries in base_[bindir|sbindir|libdir] do not link to files under exec_prefix
412 """
413 if unsafe_references_skippable(path, name, d):
414 return
415
416 if elf:
417 import subprocess as sub
418 pn = d.getVar('PN', True)
419
420 exec_prefix = d.getVar('exec_prefix', True)
421 sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
422 sysroot_path_usr = sysroot_path + exec_prefix
423
424 try:
425 ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read().decode("utf-8")
426 except bb.process.CmdError:
427 error_msg = pn + ": prelink-rtld aborted when processing %s" % path
428 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
429 return False
430
431 if sysroot_path_usr in ldd_output:
432 ldd_output = ldd_output.replace(sysroot_path, "")
433
434 pkgdest = d.getVar('PKGDEST', True)
435 packages = d.getVar('PACKAGES', True)
436
437 for package in packages.split():
438 short_path = path.replace('%s/%s' % (pkgdest, package), "", 1)
439 if (short_path != path):
440 break
441
442 base_err = pn + ": %s, installed in the base_prefix, requires a shared library under exec_prefix (%s)" % (short_path, exec_prefix)
443 for line in ldd_output.split('\n'):
444 if exec_prefix in line:
445 error_msg = "%s: %s" % (base_err, line.strip())
446 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
447
448 return False
449 408
450QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts" 409QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts"
451def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages): 410def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages):