Organize OpenPOWER BMC support as features

Add OBMC_MACHINE_FEATURES for OpenPOWER support under openpower.inc.
Select OpenPOWER features in the POWER machines' DISTRO_FEATURES so that
the features are built.

The features are:
  obmc-openpower for required base support
  obmc-openpower-extra for non-essential tools
  obmc-openpower-legacy for deprecated packages like org.openbmc and
    skeleton packages

Part of openbmc/openbmc#2652.

Change-Id: Ib9f44a0c2e243eebb6594de6554cdc3fa0d076af
Signed-off-by: Xo Wang <xow@google.com>
diff --git a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
index cc92027..cbabdbe 100644
--- a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
+++ b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
@@ -7,6 +7,9 @@
         obmc-host-state-mgmt \
         obmc-chassis-state-mgmt \
         obmc-bmc-state-mgmt \
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
         "
 
 VIRTUAL-RUNTIME_skeleton_workbook = "${MACHINE}-config"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf/machine/firestone.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf/machine/firestone.conf
index 83f91e0..34abe31 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf/machine/firestone.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf/machine/firestone.conf
@@ -12,4 +12,10 @@
 
 FLASH_SIZE = "32768"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "firestone-ipmi-inventory-map-native"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf/machine/garrison.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf/machine/garrison.conf
index 436c68a..089c312 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf/machine/garrison.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf/machine/garrison.conf
@@ -11,4 +11,10 @@
 
 FLASH_SIZE = "32768"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "garrison-ipmi-inventory-map-native"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/machine/palmetto.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/machine/palmetto.conf
index 5d71bf4..3beb585 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/machine/palmetto.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/machine/palmetto.conf
@@ -15,6 +15,12 @@
 PHOSPHOR_MRW_URI = "git://github.com/open-power/palmetto-xml"
 PHOSPHOR_MRW_REV = "82818682f2c2009c30d700df6d5f8897a3096e4f"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/obmc-inventory-data = "obmc-inventory"
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "palmetto-ipmi-inventory-map-native"
 PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "palmetto-led-manager-config-native"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/conf/machine/romulus.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/conf/machine/romulus.conf
index e5e98e9..06572a8 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/conf/machine/romulus.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/conf/machine/romulus.conf
@@ -13,5 +13,11 @@
 PHOSPHOR_MRW_URI = "git://github.com/open-power/romulus-xml"
 PHOSPHOR_MRW_REV = "14b471fbf37f5fb60261de001df83caf5f96d81f"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "romulus-ipmi-inventory-map-native"
-PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "romulus-led-manager-config-native"
\ No newline at end of file
+PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "romulus-led-manager-config-native"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
index a3b25fd..fe951e4 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
@@ -17,6 +17,12 @@
 PHOSPHOR_MRW_URI = "git://github.com/open-power/witherspoon-xml"
 PHOSPHOR_MRW_REV = "d25ba72d544b2878e322421b33a130836619664c"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 # Inhibit phosphor-hwmon-config-mrw
 VIRTUAL-RUNTIME_phosphor-hwmon-config = ""
 
diff --git a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/conf/machine/zaius.conf b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/conf/machine/zaius.conf
index 9b1050a..f337113 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/conf/machine/zaius.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/conf/machine/zaius.conf
@@ -5,6 +5,12 @@
 
 FLASH_SIZE = "65536"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/p9-vcs-workaround = 'vcs-control'
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "zaius-ipmi-inventory-map-native"
 
diff --git a/meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf b/meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
index 2d16c2e..06262df 100644
--- a/meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
@@ -13,6 +13,12 @@
 
 OBMC_FAN_INSTANCES = "0 1 2 3 4 5"
 
+DISTRO_FEATURES_append = "\
+        obmc-openpower \
+        obmc-openpower-extra \
+        obmc-openpower-legacy \
+        "
+
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "barreleye-ipmi-inventory-map-native"
 PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "barreleye-led-manager-config-native"