summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2024-05-23 09:51:43 -0600
committerMark Hatle <mark.hatle@amd.com>2024-11-21 10:43:43 -0600
commit865bee51ca49b52ebf07c9c8ff2576a01936c507 (patch)
treecaee4ebccac7662f18619cfcedba674f776a1b61
parent3fb0ec778d76d509c30dcf1e07dcdd659f823be7 (diff)
downloadmeta-xilinx-865bee51ca49b52ebf07c9c8ff2576a01936c507.tar.gz
meta-xilinx-standalone: Move to YP best practices
Follow the examples from meta-virtualization on how to enable bbappends and set PREFERRED_VERSIONS. This will require the user to set XILINX_WITH_ESW to some value. Any value will enable the components in this layer at this time. We may choose to be more selective in the future. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-standalone/classes/meta-xilinx-standalone-cfg.bbclass6
-rw-r--r--meta-xilinx-standalone/classes/sanity-meta-xilinx-standalone.bbclass10
-rw-r--r--meta-xilinx-standalone/conf/distro/include/meta-xilinx-standalone-default-versions.inc10
-rw-r--r--meta-xilinx-standalone/conf/layer.conf23
4 files changed, 40 insertions, 9 deletions
diff --git a/meta-xilinx-standalone/classes/meta-xilinx-standalone-cfg.bbclass b/meta-xilinx-standalone/classes/meta-xilinx-standalone-cfg.bbclass
new file mode 100644
index 00000000..a7367f7d
--- /dev/null
+++ b/meta-xilinx-standalone/classes/meta-xilinx-standalone-cfg.bbclass
@@ -0,0 +1,6 @@
1# We need to load the ESW and related config components, only if XILINX_WITH_ESW
2# is in defined in some way. Since we don't know the configuration during
3# layer.conf load time, we delay using a special bbclass that simply includes
4# the META_XILINX_STANDLONE_CONFIG_PATH file.
5
6include ${@'${META_XILINX_STANDALONE_CONFIG_PATH}' if d.getVar('XILINX_WITH_ESW') else ''}
diff --git a/meta-xilinx-standalone/classes/sanity-meta-xilinx-standalone.bbclass b/meta-xilinx-standalone/classes/sanity-meta-xilinx-standalone.bbclass
new file mode 100644
index 00000000..27d191c6
--- /dev/null
+++ b/meta-xilinx-standalone/classes/sanity-meta-xilinx-standalone.bbclass
@@ -0,0 +1,10 @@
1addhandler security_bbappend_distrocheck
2security_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
3python security_bbappend_distrocheck() {
4 skip_check = e.data.getVar('SKIP_META_XILINX_STANDALONE_SANITY_CHECK') == "1"
5 if not e.data.getVar('XILINX_WITH_ESW') and not skip_check:
6 bb.warn("You have included the meta-xilinx-standalone layer, but \
7it has not been enabled using XILINX_WITH_ESW in your configuration. Some \
8bbappend files and preferred version setting may not take effect. See the \
9meta-security README for details on enabling security support.")
10}
diff --git a/meta-xilinx-standalone/conf/distro/include/meta-xilinx-standalone-default-versions.inc b/meta-xilinx-standalone/conf/distro/include/meta-xilinx-standalone-default-versions.inc
new file mode 100644
index 00000000..1d17741b
--- /dev/null
+++ b/meta-xilinx-standalone/conf/distro/include/meta-xilinx-standalone-default-versions.inc
@@ -0,0 +1,10 @@
1
2# What version of ESW and related should we default to?
3# Note, there is no 'esw' recipe, but we're going to use this for all
4# of the related items in this layer.
5PREFERRED_VERSION_esw ??= "${@(d.getVar('XILINX_RELEASE_VERSION') or 'undefined').replace('v', '')}"
6
7PREFERRED_VERSION_plm-firmware ??= "${PREFERRED_VERSION_esw}%"
8PREFERRED_VERSION_psm-firmware ??= "${PREFERRED_VERSION_esw}%"
9PREFERRED_VERSION_pmu-firmware ??= "${PREFERRED_VERSION_esw}%"
10PREFERRED_VERSION_fsbl-firmware ??= "${PREFERRED_VERSION_esw}%"
diff --git a/meta-xilinx-standalone/conf/layer.conf b/meta-xilinx-standalone/conf/layer.conf
index ef4a919e..8087d5a6 100644
--- a/meta-xilinx-standalone/conf/layer.conf
+++ b/meta-xilinx-standalone/conf/layer.conf
@@ -17,12 +17,17 @@ LAYERRECOMMENDS_xilinx-standalone = "xilinx-microblaze"
17 17
18LAYERSERIES_COMPAT_xilinx-standalone = "scarthgap" 18LAYERSERIES_COMPAT_xilinx-standalone = "scarthgap"
19 19
20# What version of ESW and related should we default to? 20# Set this to enable this layer
21# Note, there is no 'esw' recipe, but we're going to use this for all 21#XILINX_WITH_ESW = "generic"
22# of the related items in this layer. 22
23PREFERRED_VERSION_esw ??= "${@(d.getVar('XILINX_RELEASE_VERSION') or 'undefined').replace('v', '')}" 23# Sanity check for meta-xilinx-standalone layer.
24 24# Setting SKIP_META_XILINX_STANDALONE_SANITY_CHECK to "1" would skip the bbappend files check.
25PREFERRED_VERSION_plm-firmware ??= "${PREFERRED_VERSION_esw}%" 25INHERIT += "sanity-meta-xilinx-standalone"
26PREFERRED_VERSION_psm-firmware ??= "${PREFERRED_VERSION_esw}%" 26
27PREFERRED_VERSION_pmu-firmware ??= "${PREFERRED_VERSION_esw}%" 27# We need to load the ESW and related config components, only if XILINX_WITH_ESW
28PREFERRED_VERSION_fsbl-firmware ??= "${PREFERRED_VERSION_esw}%" 28# is in defined in some way. Since we don't know the configuration during
29# layer.conf load time, we delay using a special bbclass that simply includes
30# the META_XILINX_STANDLONE_CONFIG_PATH file.
31META_XILINX_STANDALONE_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-xilinx-standalone-default-versions.inc"
32
33USER_CLASSES:append = " meta-xilinx-standalone-cfg"