From fed09bb2f9a4d3b38e8b3452549e1e3cc2e555c9 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 25 Apr 2023 11:06:50 -0700 Subject: device-tree: Move from file CONFIG_DTFILE access to SRC_URI Move from declaring DT_FILES_PATH to the CONFIG_DTFILE dirname, to the default where it is set to S. This adds the requirement that CONFIG_DTFILE _must_ be self contained (or preprocessed). This prevents the system from compiling any other dts (or dtsi) files located in that directory, to only the ones we've specifically requested. Additionally this simplifies the check_devicetree_variables, as hashing and file validation are now done for us by the fetchers. Signed-off-by: Mark Hatle --- meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb') diff --git a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb index df63d4a1..4662c558 100644 --- a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb +++ b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb @@ -17,7 +17,6 @@ inherit devicetree image-artifact-names # system. SYSTEM_DTFILE ??= "" CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" -DT_FILES_PATH = "${@os.path.dirname(d.getVar('CONFIG_DTFILE')) if d.getVar('CONFIG_DTFILE') else d.getVar('S')}" EXTRA_DT_FILES ?= "" EXTRA_DTFILE_PREFIX ?= "system-top" @@ -32,6 +31,11 @@ CONFIG_DTFILE[doc] = "Domain Specific Device Tree which accepts 0...1 dts file" EXTRA_DT_FILES[doc] = "Add extra files to DT_FILES_PATH, it accepts 1...n dtsi files and adds to SRC_URI" EXTRA_OVERLAYS[doc] = "Add extra files to DT_FILES_PATH and adds a #include for each to the BASE_DTS, it access 1..n dtsi files and adds to SRC_URI" +# There should only be ONE CONFIG_DTFILE listed +# These need to be passed in from global, not from a bbappend +FILESEXTRAPATHS:prepend := "${@'%s:' % os.path.dirname(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" +SRC_URI:append := " ${@'file://%s' % os.path.basename(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" + SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_FILES') or "").split()])}" SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_OVERLAYS') or "").split()])}" @@ -131,14 +135,6 @@ def check_devicetree_variables(d): if not d.getVar('CONFIG_DTFILE'): raise bb.parse.SkipRecipe("CONFIG_DTFILE or SYSTEM_DTFILE is not defined.") - else: - if not os.path.exists(d.getVar('CONFIG_DTFILE')): - if not d.getVar('WITHIN_EXT_SDK'): - raise bb.parse.SkipRecipe("The device tree %s is not available." % d.getVar('CONFIG_DTFILE')) - else: - d.appendVar('SRC_URI', ' file://${CONFIG_DTFILE}') - d.setVarFlag('do_install', 'file-checksums', '${CONFIG_DTFILE}:True') - d.setVarFlag('do_deploy', 'file-checksums', '${CONFIG_DTFILE}:True') python() { # Need to allow bbappends to change the check -- cgit v1.2.3-54-g00ecf