diff options
| author | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-24 12:14:48 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-27 08:36:00 -0800 |
| commit | 4f3edb6da405ffff957d6f194bc7db7bdd9f1463 (patch) | |
| tree | 50895bd7e0126620749adff252f5eb6b9da84540 /meta-xilinx-standalone/classes | |
| parent | c6fc0f9a034a3a3c8748e0a650f8728f8c044065 (diff) | |
| download | meta-xilinx-4f3edb6da405ffff957d6f194bc7db7bdd9f1463.tar.gz | |
xlnx-compatible-os.bbclass: Class to allow recipes to list OS compatibility
Following the example of base.bbclass in OE-Core, a new COMPATIBLE_OS
variable is defined. Similar to COMPATIBLE_MACHINE, it is a regex that
can be used to declare TARGET_OS string compatibility on a per-recipe
basis. Either the distro configuration or the recipes themselves will
need to inherit this class.
By default the class assumes we're building a Linux based system, and
thus any recipe who has not declared compatibility is compatible with
Linux. The default compatible field was copied from bitbake.conf to
ensure there are no surprised.
Additionally, enable the usage of this class throughout
meta-xilinx-standalone layer.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-standalone/classes')
| -rw-r--r-- | meta-xilinx-standalone/classes/esw.bbclass | 5 | ||||
| -rw-r--r-- | meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass | 16 |
2 files changed, 20 insertions, 1 deletions
diff --git a/meta-xilinx-standalone/classes/esw.bbclass b/meta-xilinx-standalone/classes/esw.bbclass index 65817825..4a815eb6 100644 --- a/meta-xilinx-standalone/classes/esw.bbclass +++ b/meta-xilinx-standalone/classes/esw.bbclass | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | inherit pkgconfig cmake yocto-cmake-translation | 1 | inherit pkgconfig cmake |
| 2 | 2 | ||
| 3 | LICENSE = "Proprietary" | 3 | LICENSE = "Proprietary" |
| 4 | LICFILENAME = "license.txt" | 4 | LICFILENAME = "license.txt" |
| @@ -37,6 +37,9 @@ COMPATIBLE_MACHINE_cortexr5-zynqmp = "cortexr5-zynqmp" | |||
| 37 | COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf" | 37 | COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf" |
| 38 | COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal" | 38 | COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal" |
| 39 | 39 | ||
| 40 | COMPATIBLE_OS = "elf" | ||
| 41 | COMPATIBLE_OS_arm = "eabi" | ||
| 42 | |||
| 40 | DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 43 | DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
| 41 | DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 44 | DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
| 42 | DTBFILE_cortexa53-zynqmp ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 45 | DTBFILE_cortexa53-zynqmp ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
diff --git a/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass b/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass new file mode 100644 index 00000000..4b06ddd8 --- /dev/null +++ b/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # We assume everything is Linux compatible, deviations to this | ||
| 2 | # must define their own compatible OS | ||
| 3 | COMPATIBLE_OS ?= "linux${LIBCEXTENSION}${ABIEXTENSION}" | ||
| 4 | |||
| 5 | python() { | ||
| 6 | # Only do this check for target recipes | ||
| 7 | if d.getVar('CLASSOVERRIDE') != "class-target": | ||
| 8 | return | ||
| 9 | |||
| 10 | need_os = d.getVar('COMPATIBLE_OS') | ||
| 11 | if need_os: | ||
| 12 | import re | ||
| 13 | target_os = d.getVar('TARGET_OS') | ||
| 14 | if not re.match(need_os, target_os): | ||
| 15 | raise bb.parse.SkipRecipe("incompatible with os %s (not in COMPATIBLE_OS '%s')" % (target_os, need_os)) | ||
| 16 | } | ||
