Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 1 | |
| 2 | valid_xen_archs = " \ |
| 3 | x86_64 x86_32 \ |
| 4 | arm32 arm64 \ |
| 5 | " |
| 6 | |
| 7 | def map_xen_arch(a, d): |
| 8 | import re |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | valid_archs = d.getVar('valid_xen_archs').split() |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 10 | |
| 11 | if re.match("i.86", a): return "x86_32" |
| 12 | elif re.match("x86.64", a): return "x86_64" |
| 13 | elif re.match("arm.*", a): return "arm32" |
| 14 | elif re.match("aarch64.*", a): return "arm64" |
| 15 | elif a in valid_archs: return a |
| 16 | else: |
| 17 | return "INVALID" |
| 18 | |