blob: 5d1242505745b4a6f2ae19eaee2aa001894588eb [file] [log] [blame]
Alexander Amelkin68a967d2018-02-02 12:01:13 +03001#!/bin/sh
2
3if [ "$(basename -- "$0")" = "setup" ]; then
4 echo The script must be sourced, not executed
5 exit 1
6fi
7
8machine() {
9 local target=$1
10 local arch mfg mach realmach
11 for arch in meta-openbmc-machines/meta-*; do
12 for mfg in $arch/meta-*; do
13 for mach in $mfg/meta-*; do
14 if [ -d "$mach" -a -d "$mach/conf/machine" ]; then
15 realmach=${mach##*meta-}
16 # If a target is specified, then check for a match,
17 # otherwise just list what we've discovered
18 if [ -n "$target" ]; then
19 if [ "$realmach" = "$target" ]; then
20 echo Machine $target is $mach
21 TEMPLATECONF="$mach/conf" source oe-init-build-env build
22 return
23 fi
24 else
25 echo "$realmach"
26 fi
27 fi
28 done
29 done
30 done
31
32 [ -n "$target" ] && echo "No such machine!"
33}
34
35if [ -z "$1" ]; then
36 echo Target machine must be specified. Use one of:
37 echo
38 echo qemuarm
39elif [ "$1" = "qemuarm" ]; then
40 source openbmc-env
41fi
42
43machine $1 | sort