From cbcd6f4c549b9e9119545a17a48191930841739d Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Wed, 30 Mar 2022 10:32:22 -0500 Subject: 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 Change-Id: Ide141c879dd674fe3771984f7fd41006a64ce54f --- setup | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'setup') diff --git a/setup b/setup index 647022fb5e..5655bfa817 100755 --- a/setup +++ b/setup @@ -33,27 +33,34 @@ machine() { 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 @@ machine() { } 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 -- cgit v1.2.3