summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAmarnath Valluri <amarnath.valluri@intel.com>2017-06-14 14:30:46 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-06 14:38:15 +0100
commit2ea87f74da88566c2c8017dbd545632f7acea4fd (patch)
tree0d8a991dc6a0c8d4db89fe47b82f89b99cdc9600 /meta
parent66cf94e74073fffc40b6317ba706f59a0d7b2502 (diff)
downloadpoky-2ea87f74da88566c2c8017dbd545632f7acea4fd.tar.gz
insane.bbclass: Add package QA check for merged /usr.
This check makes sure that, when usrmerge distro feature enabled, no package installs files to root (/bin, /sbin, /lib, /lib64) folders. (From OE-Core rev: 9f52f9f60f5680d7a824dafb3334de624eceed4c) Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/insane.bbclass16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 0e974b5147..7680a59d64 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -40,6 +40,9 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
40 version-going-backwards expanded-d invalid-chars \ 40 version-going-backwards expanded-d invalid-chars \
41 license-checksum dev-elf file-rdeps \ 41 license-checksum dev-elf file-rdeps \
42 " 42 "
43# Add usrmerge QA check based on distro feature
44ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
45
43FAKEROOT_QA = "host-user-contaminated" 46FAKEROOT_QA = "host-user-contaminated"
44FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ 47FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
45enabled tests are listed here, the do_package_qa task will run under fakeroot." 48enabled tests are listed here, the do_package_qa task will run under fakeroot."
@@ -991,6 +994,18 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
991 check_valid_deps('RREPLACES') 994 check_valid_deps('RREPLACES')
992 check_valid_deps('RCONFLICTS') 995 check_valid_deps('RCONFLICTS')
993 996
997QAPKGTEST[usrmerge] = "package_qa_check_usrmerge"
998def package_qa_check_usrmerge(pkg, d, messages):
999 pkgdest = d.getVar('PKGDEST')
1000 pkg_dir = pkgdest + os.sep + pkg + os.sep
1001 merged_dirs = ['bin', 'sbin', 'lib'] + d.getVar('MULTILIB_VARIANTS').split()
1002 for f in merged_dirs:
1003 if os.path.exists(pkg_dir + f) and not os.path.islink(pkg_dir + f):
1004 msg = "%s package is not obeying usrmerge distro feature. /%s should be relocated to /usr." % (pkg, f)
1005 package_qa_add_message(messages, "usrmerge", msg)
1006 return False
1007 return True
1008
994QAPKGTEST[expanded-d] = "package_qa_check_expanded_d" 1009QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
995def package_qa_check_expanded_d(package, d, messages): 1010def package_qa_check_expanded_d(package, d, messages):
996 """ 1011 """
@@ -1064,6 +1079,7 @@ def package_qa_check_host_user(path, name, d, elf, messages):
1064 return False 1079 return False
1065 return True 1080 return True
1066 1081
1082
1067# The PACKAGE FUNC to scan each package 1083# The PACKAGE FUNC to scan each package
1068python do_package_qa () { 1084python do_package_qa () {
1069 import subprocess 1085 import subprocess