diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2022-11-07 13:55:13 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2022-11-10 15:04:42 -0800 |
| commit | e041b4fd3be52c1804e63a64cf2764be0c5c8675 (patch) | |
| tree | 2eff6fe2152a32da7de5fda43a4b77f65c43b72c /meta-xilinx-core/classes/xilinx-vars.bbclass | |
| parent | 7a7009d7090a8058b3d9504d2a2e3d84ed149d9b (diff) | |
| download | meta-xilinx-e041b4fd3be52c1804e63a64cf2764be0c5c8675.tar.gz | |
conf/machine: Better document inheritence expectations
See the README files for specific requirements, but we have designed the
machine configurations into an inheritance model. This module can be
further broken into 3 distinct categories of variables:
1 - Variables that MUST be declared BEFORE inheriting the base machine
2 - Variables that SHOULD be declared BEFORE inheriting the base machine,
as they are commonly overridden. (This will need continual review.)
3 - All remaining variables that should only be declared in the machine
.conf file, and MUST be declared AFTER inheriting the base machine.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/classes/xilinx-vars.bbclass')
| -rw-r--r-- | meta-xilinx-core/classes/xilinx-vars.bbclass | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meta-xilinx-core/classes/xilinx-vars.bbclass b/meta-xilinx-core/classes/xilinx-vars.bbclass new file mode 100644 index 00000000..a1a0e38c --- /dev/null +++ b/meta-xilinx-core/classes/xilinx-vars.bbclass | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # Check variable usage to make sure that the machine is probably configured | ||
| 2 | # properly. | ||
| 3 | addhandler xilinx_variables_config_eventhandler | ||
| 4 | xilinx_variables_config_eventhandler[eventmask] = "bb.event.ConfigParsed" | ||
| 5 | |||
| 6 | # It's up to the base sytem to define the variables being used here, we're | ||
| 7 | # only going to check them. | ||
| 8 | python xilinx_variables_config_eventhandler () { | ||
| 9 | # Verify HDF_MACHINE | ||
| 10 | hdf_prior = d.getVar('HDF_MACHINE_PRIOR') | ||
| 11 | hdf_final = d.getVar('HDF_MACHINE') | ||
| 12 | |||
| 13 | if hdf_prior and hdf_prior != hdf_final: | ||
| 14 | bb.fatal("HDF_MACHINE is set to %s, it appears you intended %s. " \ | ||
| 15 | "This is usually as a result of specifying it in the local.conf or before the 'require' in the machine .conf file. " \ | ||
| 16 | "See meta-xilinx-core/conf/machine/README." % (hdf_final, hdf_prior)) | ||
| 17 | |||
| 18 | # Verify DEFAULTTUNE | ||
| 19 | tune_prior = d.getVar('DEFAULTTUNE_PRIOR') | ||
| 20 | tune_final = d.getVar('DEFAULTTUNE') | ||
| 21 | |||
| 22 | if tune_prior and tune_prior != tune_final: | ||
| 23 | bb.fatal("The loaded DEFAULTTUNE is %s, but it appears you intended %s. " \ | ||
| 24 | "This is usually as a result of specifying it after the 'require' in the machine .conf file. " \ | ||
| 25 | "See meta-xilinx-core/conf/machine/README." % (tune_prior, tune_final)) | ||
| 26 | } | ||
