diff options
author | Richard Purdie <richard@openedhand.com> | 2008-05-07 09:49:38 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-05-07 09:49:38 +0000 |
commit | 1b969af1b947a0c216cf17bba73fe7d07c411c98 (patch) | |
tree | 9d71bfecb0ea6b9db2c1a0fb18f600f5c489eae2 /meta | |
parent | 63d12962f2b0a452e1b18dcbd9bc96cec946e9dd (diff) | |
download | poky-1b969af1b947a0c216cf17bba73fe7d07c411c98.tar.gz |
sanity.bbclass: Sync with OE, introduce TMPDIR ABI versioning, drop bitbake 1.8.6 cruft, only run the mmap_min_addr check on ARM when we need to run binary locale generation
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4450 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sanity.bbclass | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index b8fc090184..2de023f962 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -62,9 +62,10 @@ def check_sanity(e): | |||
62 | if "diffstat-native" not in assume_provided: | 62 | if "diffstat-native" not in assume_provided: |
63 | messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' | 63 | messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' |
64 | 64 | ||
65 | # Check that the MACHINE is valid | 65 | # Check that the MACHINE is valid, if it is set |
66 | if not check_conf_exists("conf/machine/${MACHINE}.conf", e.data): | 66 | if data.getVar('MACHINE', e.data, True): |
67 | messages = messages + 'Please set a valid MACHINE in your local.conf\n' | 67 | if not check_conf_exists("conf/machine/${MACHINE}.conf", e.data): |
68 | messages = messages + 'Please set a valid MACHINE in your local.conf\n' | ||
68 | 69 | ||
69 | # Check that the DISTRO is valid | 70 | # Check that the DISTRO is valid |
70 | # need to take into account DISTRO renaming DISTRO | 71 | # need to take into account DISTRO renaming DISTRO |
@@ -96,11 +97,12 @@ def check_sanity(e): | |||
96 | if not check_app_exists("qemu-arm", e.data): | 97 | if not check_app_exists("qemu-arm", e.data): |
97 | messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH" | 98 | messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH" |
98 | 99 | ||
99 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): | 100 | if data.getVar('TARGET_ARCH', e.data, True) == "arm": |
100 | f = file("/proc/sys/vm/mmap_min_addr", "r") | 101 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): |
101 | if (f.read().strip() != "0"): | 102 | f = file("/proc/sys/vm/mmap_min_addr", "r") |
102 | messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n" | 103 | if (f.read().strip() != "0"): |
103 | f.close() | 104 | messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n" |
105 | f.close() | ||
104 | 106 | ||
105 | for util in required_utilities.split(): | 107 | for util in required_utilities.split(): |
106 | if not check_app_exists( util, e.data ): | 108 | if not check_app_exists( util, e.data ): |
@@ -136,6 +138,25 @@ def check_sanity(e): | |||
136 | f.write(tmpdir) | 138 | f.write(tmpdir) |
137 | f.close() | 139 | f.close() |
138 | 140 | ||
141 | # | ||
142 | # Check the 'ABI' of TMPDIR | ||
143 | # | ||
144 | current_abi = data.getVar('SANITY_ABI', e.data, True) | ||
145 | abifile = data.getVar('SANITY_ABIFILE', e.data, True) | ||
146 | if os.path.exists(abifile): | ||
147 | f = file(abifile, "r") | ||
148 | abi = f.read().strip() | ||
149 | if not abi.isdigit(): | ||
150 | f = file(abifile, "w") | ||
151 | f.write(current_abi) | ||
152 | elif (abi != current_abi): | ||
153 | # Code to convert from one ABI to another could go here if possible. | ||
154 | messages = messages + "Error, TMPDIR has changed ABI (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi) | ||
155 | else: | ||
156 | f = file(abifile, "w") | ||
157 | f.write(current_abi) | ||
158 | f.close() | ||
159 | |||
139 | if messages != "": | 160 | if messages != "": |
140 | raise_sanity_error(messages) | 161 | raise_sanity_error(messages) |
141 | 162 | ||
@@ -144,17 +165,7 @@ python check_sanity_eventhandler() { | |||
144 | from bb import note, error, data, __version__ | 165 | from bb import note, error, data, __version__ |
145 | from bb.event import getName | 166 | from bb.event import getName |
146 | 167 | ||
147 | try: | 168 | if getName(e) == "ConfigParsed": |
148 | from distutils.version import LooseVersion | ||
149 | except ImportError: | ||
150 | def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1 | ||
151 | |||
152 | if (LooseVersion(bb.__version__) > LooseVersion("1.8.6")): | ||
153 | if getName(e) == "ConfigParsed": | ||
154 | check_sanity(e) | ||
155 | return NotHandled | ||
156 | |||
157 | if getName(e) == "BuildStarted": | ||
158 | check_sanity(e) | 169 | check_sanity(e) |
159 | 170 | ||
160 | return NotHandled | 171 | return NotHandled |