setup: enable all qemu* machines
The existing support for qemuarm wasn't working. Sometimes, when
submitting recipes to upstream, it is useful to test image builds
against various qemu* machine models. Enhance the setup script so that
we can build any of the qemu* machines that Poky supports and treat them
like a generic meta-phosphor machine.
Tested: Used `setup qemumips` and was able to `bitbake phosphor-image`
successfully.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ide141c879dd674fe3771984f7fd41006a64ce54f
diff --git a/setup b/setup
index 647022f..5655bfa 100755
--- a/setup
+++ b/setup
@@ -33,27 +33,34 @@
local cfg name tmpl
local configs
- # zsh requires wordsplit so that variable expansion behaves like bash
- if [ -n "$ZSH_NAME" ]; then
- setopt local_options shwordsplit
- fi
- if which find > /dev/null 2>&1; then
- configs=$(find meta-* -path "*/conf/machine/*.conf")
- else
- configs=$(ls -1 meta-*/meta-*/conf/machine/*.conf meta-*/conf/machine/*.conf)
- fi
+ # zsh requires wordsplit so that variable expansion behaves like bash
+ if [ -n "$ZSH_NAME" ]; then
+ setopt local_options shwordsplit
+ fi
+ if which find > /dev/null 2>&1; then
+ configs="$(find meta-* -path "*/conf/machine/*.conf")"
+ else
+ configs=$(ls -1 meta-*/meta-*/conf/machine/*.conf meta-*/conf/machine/*.conf)
+ fi
+ # Add qemu machines.
+ configs="$configs $(ls -1 poky/meta/conf/machine/qemu*.conf)"
for cfg in $configs; do
name=${cfg##*/}
name=${name%.conf}
tmpl=${cfg%/machine/*.conf}
- # Skip any machines that don't support meta-phosphor.
- if [ ! -e "$tmpl/bblayers.conf.sample" ]; then
- continue
- fi
- if ! grep -q "##OEROOT##/meta-phosphor" "$tmpl/bblayers.conf.sample"; then
- continue
+ if [ "$tmpl" = "poky/meta/conf" ]; then
+ # This is a QEMU machine, use phosphor defaults.
+ tmpl="meta-phosphor/conf"
+ else
+ # Skip any machines that don't support meta-phosphor.
+ if [ ! -e "$tmpl/bblayers.conf.sample" ]; then
+ continue
+ fi
+ if ! grep -q "##OEROOT##/meta-phosphor" "$tmpl/bblayers.conf.sample"; then
+ continue
+ fi
fi
# If a target is specified, then check for a match,
@@ -80,11 +87,9 @@
}
if [ -z "$1" ]; then
- echo Target machine must be specified. Use one of:
- echo
- (echo qemuarm; machine) | sort | $COLUMN
-elif [ "$1" = "qemuarm" ]; then
- source openbmc-env
+ echo Target machine must be specified. Use one of:
+ echo
+ machine | sort | $COLUMN
else
bld_dir=$2
if [ -z "$2" ]; then