summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2013-03-13 16:24:59 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2013-03-15 11:04:55 +0000
commitf1cdf64cd5fa4271403286271ead511989ce15a1 (patch)
tree4b02dc53e10770da9aca05fb6e166bf020a55e26 /morphlib/morphologyfactory.py
parent89c0777fa1c8918f8402b64484b16b6c715c441b (diff)
downloadmorph-f1cdf64cd5fa4271403286271ead511989ce15a1.tar.gz
One 'arch' to rule them all
Define a specific set of 4 architectures that Morph supports, and only expose that value to morphologies. Since GNU triplets are very common we also expose a GNU triplet. Other morphologies should work out their configuration based on MORPH_ARCH. This commit also removes the morphlib.util.arch() function, which detected the machine Morph is running on via 'uname -m'. Morph's architecture names do not necessarily map to the output of 'uname -m' so we should not rely on it anywhere.
Diffstat (limited to 'morphlib/morphologyfactory.py')
-rw-r--r--morphlib/morphologyfactory.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index 7ae68697..e9d2b1c5 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -106,6 +106,16 @@ class MorphologyFactory(object):
'(arch is a mandatory field)' %
filename)
+ valid_archs = ['armv7l', 'armv7b', 'x86_32', 'x86_64']
+
+ if morphology['arch'] == 'armv7':
+ morphology._dict['arch'] = 'armv7l'
+
+ if morphology['arch'] not in valid_archs:
+ raise morphlib.Error('Unknown arch %s. This version of Morph '
+ 'supports the following architectures: %s' %
+ (morphology['arch'], ', '.join(valid_archs)))
+
if not morphology['system-kind']:
raise morphlib.Error('No system-kind defined in system %s '
'(it is a mandatory field)' % filename)