summaryrefslogtreecommitdiffstats
path: root/setup
blob: 5d1242505745b4a6f2ae19eaee2aa001894588eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

if [ "$(basename -- "$0")" = "setup" ]; then
	echo The script must be sourced, not executed
	exit 1
fi

machine() {
	local target=$1
	local arch mfg mach realmach
	for arch in meta-openbmc-machines/meta-*; do
		for mfg in $arch/meta-*; do
			for mach in $mfg/meta-*; do
				if [ -d "$mach" -a -d "$mach/conf/machine" ]; then
					realmach=${mach##*meta-}
					# If a target is specified, then check for a match,
					# otherwise just list what we've discovered
					if [ -n "$target" ]; then
						if [ "$realmach" = "$target" ]; then
							echo Machine $target is $mach
							TEMPLATECONF="$mach/conf" source oe-init-build-env build
							return
						fi
					else
						echo "$realmach"
					fi
				fi
			done
		done
	done

	[ -n "$target" ] && echo "No such machine!"
}

if [ -z "$1" ]; then
	echo Target machine must be specified. Use one of:
	echo
	echo qemuarm
elif [ "$1" = "qemuarm" ]; then
	source openbmc-env
fi

machine $1 | sort
OpenPOWER on IntegriCloud