build-setup: explicitly set MACHINE and DISTRO

An OE based build system typically has three inputs from the user; the
machine target (MACHINE), the distro policy (DISTRO), and the package
content (aka image/recipe being baked).

Using TEMPLATECONF to generate local.conf attempts to map the machine
target and distro policy down to a single input but is an abuse of
TEMPLATECONF and places constraints on use of conventional OE metadata
structure paradigms.  For example a layer can only provide a single
local.conf.sample but can support multiple machine targets and distro
policy sets.

Formalize a "target" for the build-setup script to be the desired
MACHINE+DISTRO combination.  Explicitly declere the desired combination
for each target.  This allows layer authors full flexibility when
organizing their metadata.

Change-Id: Ia6a335135966b82120513c75d1617bf70b811a2e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/build-setup.sh b/build-setup.sh
index 10545cd..ea35b29 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -127,39 +127,58 @@
 case ${target} in
   palmetto)
     LAYER_DIR="meta-ibm/meta-palmetto"
+    MACHINE="palmetto"
+    DISTRO="openbmc-openpower"
     ;;
   swift)
     LAYER_DIR="meta-ibm/meta-witherspoon"
     MACHINE="swift"
+    DISTRO="openbmc-witherspoon"
     ;;
   mihawk)
     LAYER_DIR="meta-ibm/meta-witherspoon"
     MACHINE="mihawk"
+    DISTRO="openbmc-witherspoon"
     ;;
   witherspoon)
     LAYER_DIR="meta-ibm/meta-witherspoon"
+    MACHINE="witherspoon"
+    DISTRO="openbmc-witherspoon"
     ;;
   witherspoon-128)
     LAYER_DIR="meta-ibm/meta-witherspoon"
     MACHINE="witherspoon-128"
+    DISTRO="openbmc-witherspoon"
     ;;
   evb-ast2500)
     LAYER_DIR="meta-evb/meta-evb-aspeed/meta-evb-ast2500"
+    MACHINE="evb-ast2500"
+    DISTRO="openbmc-phosphor"
     ;;
   s2600wf)
     LAYER_DIR="meta-intel/meta-s2600wf"
+    MACHINE="s2600wf"
+    DISTRO="openbmc-phosphor"
     ;;
   zaius)
     LAYER_DIR="meta-ingrasys/meta-zaius"
+    MACHINE="zaius"
+    DISTRO="openbmc-openpower"
     ;;
   romulus)
     LAYER_DIR="meta-ibm/meta-romulus"
+    MACHINE="romulus"
+    DISTRO="openbmc-openpower"
     ;;
   tiogapass)
     LAYER_DIR="meta-facebook/meta-tiogapass"
+    MACHINE="tiogapass"
+    DISTRO="openbmc-phosphor"
     ;;
   gsj)
     LAYER_DIR="meta-quanta/meta-gsj"
+    MACHINE="gsj"
+    DISTRO="openbmc-phosphor"
     ;;
   *)
     exit 1
@@ -324,11 +343,14 @@
 # Source our build env
 ${BITBAKE_CMD}
 
-# Export MACHINE name when given for build target
-if [[ -n "${MACHINE}" ]]; then
-  export MACHINE="${MACHINE}"
+if [[ -n "${MACHINE}" || -n "${DISTRO}" ]]; then
+  echo "MACHINE or DISTRO is not configured for ${target}"
+  exit 1
 fi
 
+export MACHINE="${MACHINE}"
+export DISTRO="${DISTRO}"
+
 # Custom BitBake config settings
 cat >> conf/local.conf << EOF_CONF
 BB_NUMBER_THREADS = "$(nproc)"