avsbus-control: Add system-specific scripts

The avsbus-control scripts differ between different machine
configurations. Rename the existing ones to witherspoon-* and
add the swift-* ones. Install the appropriate script depending
on the machine being built.

Tested: Built swift and witherspoon and verified that the scripts
        rootfs/usr/bin/ were the ones for the machine being built.

Change-Id: If6a223f2972680769d526c0ef53cf5ca82337721
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/meta-witherspoon/recipes-phosphor/chassis/avsbus-control.bb b/meta-witherspoon/recipes-phosphor/chassis/avsbus-control.bb
index 5abe1be..414d0b8 100644
--- a/meta-witherspoon/recipes-phosphor/chassis/avsbus-control.bb
+++ b/meta-witherspoon/recipes-phosphor/chassis/avsbus-control.bb
@@ -8,18 +8,42 @@
 RDEPENDS_${PN} += "i2c-tools"
 
 S = "${WORKDIR}"
-SRC_URI += "file://power-workarounds.sh \
-            file://avsbus-enable.sh \
-            file://avsbus-disable.sh"
+SRC_URI_append_swift = " file://swift-avsbus-disable.sh"
+SRC_URI_append_swift = " file://swift-avsbus-enable.sh"
+SRC_URI_append_swift = " file://swift-power-workarounds.sh"
+SRC_URI_append_witherspoon = " file://witherspoon-avsbus-disable.sh"
+SRC_URI_append_witherspoon = " file://witherspoon-avsbus-enable.sh"
+SRC_URI_append_witherspoon = " file://witherspoon-power-workarounds.sh"
+SRC_URI_append_witherspoon-128 = " file://witherspoon-avsbus-disable.sh"
+SRC_URI_append_witherspoon-128 = " file://witherspoon-avsbus-enable.sh"
+SRC_URI_append_witherspoon-128 = " file://witherspoon-power-workarounds.sh"
 
 do_install() {
         install -d ${D}${bindir}
-        install -m 0755 ${WORKDIR}/power-workarounds.sh \
-            ${D}${bindir}/power-workarounds.sh
-        install -m 0755 ${WORKDIR}/avsbus-disable.sh \
+}
+do_install_append_swift() {
+        install -m 0755 ${WORKDIR}/swift-avsbus-disable.sh \
             ${D}${bindir}/avsbus-disable.sh
-        install -m 0755 ${WORKDIR}/avsbus-enable.sh \
+        install -m 0755 ${WORKDIR}/swift-avsbus-enable.sh \
             ${D}${bindir}/avsbus-enable.sh
+        install -m 0755 ${WORKDIR}/swift-power-workarounds.sh \
+            ${D}${bindir}/power-workarounds.sh
+}
+do_install_append_witherspoon() {
+        install -m 0755 ${WORKDIR}/witherspoon-avsbus-disable.sh \
+            ${D}${bindir}/avsbus-disable.sh
+        install -m 0755 ${WORKDIR}/witherspoon-avsbus-enable.sh \
+            ${D}${bindir}/avsbus-enable.sh
+        install -m 0755 ${WORKDIR}/witherspoon-power-workarounds.sh \
+            ${D}${bindir}/power-workarounds.sh
+}
+do_install_append_witherspoon-128() {
+        install -m 0755 ${WORKDIR}/witherspoon-avsbus-disable.sh \
+            ${D}${bindir}/avsbus-disable.sh
+        install -m 0755 ${WORKDIR}/witherspoon-avsbus-enable.sh \
+            ${D}${bindir}/avsbus-enable.sh
+        install -m 0755 ${WORKDIR}/witherspoon-power-workarounds.sh \
+            ${D}${bindir}/power-workarounds.sh
 }
 
 TMPL_EN= "avsbus-enable@.service"