diff options
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r-- | meta/classes/sanity.bbclass | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 3262d08fbf..03a9792f68 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -703,6 +703,23 @@ def check_sanity_version_change(status, d): | |||
703 | if (tmpdirmode & stat.S_ISUID): | 703 | if (tmpdirmode & stat.S_ISUID): |
704 | status.addresult("TMPDIR is setuid, please don't build in a setuid directory") | 704 | status.addresult("TMPDIR is setuid, please don't build in a setuid directory") |
705 | 705 | ||
706 | # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS | ||
707 | pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",") | ||
708 | workdir = d.getVar('WORKDIR', expand=True) | ||
709 | for i in pseudoignorepaths: | ||
710 | if i and workdir.startswith(i): | ||
711 | status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n") | ||
712 | |||
713 | # Check if PSEUDO_IGNORE_PATHS and and paths under pseudo control overlap | ||
714 | pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",") | ||
715 | pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}" | ||
716 | pseudocontroldir = d.expand(pseudo_control_dir).split(",") | ||
717 | for i in pseudoignorepaths: | ||
718 | for j in pseudocontroldir: | ||
719 | if i and j: | ||
720 | if j.startswith(i): | ||
721 | status.addresult("A path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " overlap and this will break pseudo permission and ownership tracking. Please set the path " + str(j) + " to a different directory which does not overlap with pseudo controlled directories. \n") | ||
722 | |||
706 | # Some third-party software apparently relies on chmod etc. being suid root (!!) | 723 | # Some third-party software apparently relies on chmod etc. being suid root (!!) |
707 | import stat | 724 | import stat |
708 | suid_check_bins = "chown chmod mknod".split() | 725 | suid_check_bins = "chown chmod mknod".split() |
@@ -787,6 +804,11 @@ def check_sanity_everybuild(status, d): | |||
787 | if "." in paths or "./" in paths or "" in paths: | 804 | if "." in paths or "./" in paths or "" in paths: |
788 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") | 805 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") |
789 | 806 | ||
807 | #Check if bitbake is present in PATH environment variable | ||
808 | bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake') | ||
809 | if not bb_check: | ||
810 | bb.warn("bitbake binary is not found in PATH, did you source the script?") | ||
811 | |||
790 | # Check whether 'inherit' directive is found (used for a class to inherit) | 812 | # Check whether 'inherit' directive is found (used for a class to inherit) |
791 | # in conf file it's supposed to be uppercase INHERIT | 813 | # in conf file it's supposed to be uppercase INHERIT |
792 | inherit = d.getVar('inherit') | 814 | inherit = d.getVar('inherit') |
@@ -860,13 +882,18 @@ def check_sanity_everybuild(status, d): | |||
860 | except: | 882 | except: |
861 | pass | 883 | pass |
862 | 884 | ||
863 | oeroot = d.getVar('COREBASE') | 885 | for checkdir in ['COREBASE', 'TMPDIR']: |
864 | if oeroot.find('+') != -1: | 886 | val = d.getVar(checkdir) |
865 | status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.") | 887 | if val.find('..') != -1: |
866 | if oeroot.find('@') != -1: | 888 | status.addresult("Error, you have '..' in your %s directory path. Please ensure the variable contains an absolute path as this can break some recipe builds in obtuse ways." % checkdir) |
867 | status.addresult("Error, you have an invalid character (@) in your COREBASE directory path. Please move the installation to a directory which doesn't include any @ characters.") | 889 | if val.find('+') != -1: |
868 | if oeroot.find(' ') != -1: | 890 | status.addresult("Error, you have an invalid character (+) in your %s directory path. Please move the installation to a directory which doesn't include any + characters." % checkdir) |
869 | status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.") | 891 | if val.find('@') != -1: |
892 | status.addresult("Error, you have an invalid character (@) in your %s directory path. Please move the installation to a directory which doesn't include any @ characters." % checkdir) | ||
893 | if val.find(' ') != -1: | ||
894 | status.addresult("Error, you have a space in your %s directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this." % checkdir) | ||
895 | if val.find('%') != -1: | ||
896 | status.addresult("Error, you have an invalid character (%) in your %s directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters." % checkdir) | ||
870 | 897 | ||
871 | # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS | 898 | # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS |
872 | import re | 899 | import re |