meta-phosphor: fans: enable non-native recipes
There exists a number native class recipes throughout meta-phosphor that
simply provide a data (often YAML) file as input to building another
application.
Having these data file recipes implemented as native class recipes
prevents the use of machine overrides because bitbake (rightfully so)
discards machine qualifiers from native recipes. Further, data files
aren't really any different than library header files and those are
consumed by recipes as target class recipes that are DEPENDed on. Do
the same thing for data file recipes.
A number of steps (patches) are required to ensure backward
compatibility while other BSP layers make the transition to target class
recipes.
This patch is the first step in the sequence. Each native class recipe
is duplicated with (approximately) the following transformation applied:
1 - remove "inherit native"
2 - add "inherit allarch"
3 - Add appropriate files to FILES_${PN}
Also fixed a couple idiosyncrasies like SRC_URI += and LIC_FILES_CHKSUM
that are not required.
Finally, add a temporary layer of indirection around STAGING_DIR_NATIVE
and STAGING_DIR_HOST to the fan metadata until other BSP layers have
fully transitioned to target class config recipes.
Change-Id: I904fbed0c4bba0d58a94e40c97e76a69e35717f2
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/conf/distro/include/phosphor-defaults.inc b/conf/distro/include/phosphor-defaults.inc
index 2fed684..ee38c56 100644
--- a/conf/distro/include/phosphor-defaults.inc
+++ b/conf/distro/include/phosphor-defaults.inc
@@ -1,3 +1,5 @@
+PHOSPHOR_FAN_CONFIG_USE_NATIVE_SYSROOT ?= "1"
+PHOSPHOR_FAN_CONFIG_RECIPE_SUFFIX = "${@bb.utils.contains('PHOSPHOR_FAN_CONFIG_USE_NATIVE_SYSROOT', '1', '-native', '', d)}"
OBMC_BMC_INSTANCES ?= "0"
OBMC_CHASSIS_INSTANCES ?= "0"
OBMC_CHECKSTOP_INSTANCES ?= "0"
@@ -194,21 +196,20 @@
PREFERRED_PROVIDER_virtual/phosphor-logging-callouts ?= \
"phosphor-logging-callouts-example-native"
-# The phosphor-fan-presence application is data driven and requires an
-# input YAML that maps fans to their tach sensors.
-# This virtual is a native recipe that provides that mapping by installing
-# configuration files in the format and native sysroot location expected by
-# the phosphor-fan-presence build process in the native sysroot.
+# The phosphor-fan-presence application is data driven and requires an input
+# YAML that maps fans to their tach sensors. This virtual is a recipe that
+# provides that mapping by installing configuration files in the format and
+# sysroot location expected by the phosphor-fan-presence build process in the
+# sysroot.
PREFERRED_PROVIDER_virtual/phosphor-fan-presence-config ?= \
- "phosphor-fan-presence-config-native"
+ "phosphor-fan-presence-config${PHOSPHOR_FAN_CONFIG_RECIPE_SUFFIX}"
-# The phosphor-fan-control application is data driven and requires a YAML
-# file to define the fans in the system.
-# This virtual is a native recipe that provides that definition by installing
-# the YAML file in the format and native sysroot location expected by
-# the phosphor-fan-control build process in the native sysroot.
+# The phosphor-fan-control application is data driven and requires a YAML file
+# to define the fans in the system. This virtual is a recipe that provides
+# that definition by installing the YAML file in the format and sysroot
+# location expected by the phosphor-fan-control build process in the sysroot.
PREFERRED_PROVIDER_virtual/phosphor-fan-control-fan-config ?= \
- "phosphor-fan-control-fan-config-native"
+ "phosphor-fan-control-fan-config${PHOSPHOR_FAN_CONFIG_RECIPE_SUFFIX}"
# The phosphor-gpio-monitor application is data-driven and requires an input.
# The application then watches the passed in input event entry for the