summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2023-05-10 14:05:45 -0600
committerMark Hatle <mark.hatle@amd.com>2023-05-13 10:20:48 -0500
commitcfe79c4db1155280c905166d932ebf09a6a08b67 (patch)
tree0013e11b5e933ca42318c9de4e838da2657b8b78
parentc3461c709721fb14cc64e691e3fbda80f01cb4ca (diff)
downloadmeta-xilinx-cfe79c4db1155280c905166d932ebf09a6a08b67.tar.gz
device-tree: Fix EXTRA_DT_FILES and EXTRA_OVERLAYS
If the WORKDIR == DT_FILES_PATH the copy operations will fail. Identify when this case happens and skip the copy as unnecessary. (This is the default configuration.) Signed-off-by: Mark Hatle <mark.hatle@amd.com> Copy the EXTRA_DT_FILES and EXTRA_OVERLAYS files in prepend operation so that it can be preprocessed. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb26
1 files changed, 22 insertions, 4 deletions
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 718857e8..a35df4ac 100644
--- a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb
+++ b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb
@@ -59,13 +59,31 @@ DTB_FILE_NAME = "${@os.path.basename(d.getVar('CONFIG_DTFILE')).replace('.dts',
59 59
60DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" 60DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}"
61 61
62do_configure:append () { 62# Copy the EXTRA_DT_FILES and EXTRA_OVERLAYS files in prepend operation so that
63 for f in ${EXTRA_DT_FILES}; do 63# it can be preprocessed.
64 cp ${WORKDIR}/${f} ${DT_FILES_PATH}/ 64do_configure:prepend () {
65 # Create DT_FILES_PATH directory if doesn't exist during prepend operation.
66 if [ ! -d ${DT_FILES_PATH} ]; then
67 mkdir -p ${DT_FILES_PATH}
68 fi
69
70 for f in ${EXTRA_DT_FILES} ${EXTRA_OVERLAYS}; do
71 if [ "$(realpath ${WORKDIR}/${f})" != "$(realpath ${DT_FILES_PATH}/`basename ${f}`)" ]; then
72 cp ${WORKDIR}/${f} ${DT_FILES_PATH}/
73 fi
65 done 74 done
75}
66 76
77do_configure:append () {
67 for f in ${EXTRA_OVERLAYS}; do 78 for f in ${EXTRA_OVERLAYS}; do
68 cp ${WORKDIR}/${f} ${DT_FILES_PATH}/ 79 if [ ! -e ${DT_FILES_PATH}/${BASE_DTS}.dts ]; then
80 if [ -e ${DT_FILES_PATH}/${BASE_DTS}.dtb ]; then
81 bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_OVERLAYS you must use a 'dts' and not 'dtb' in CONFIG_DTFILE"
82 else
83 bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_OVERLAYS you must set a valid CONFIG_DTFILE or use system-top.dts"
84 fi
85 exit 1
86 fi
69 echo "/include/ \"$f\"" >> ${DT_FILES_PATH}/${BASE_DTS}.dts 87 echo "/include/ \"$f\"" >> ${DT_FILES_PATH}/${BASE_DTS}.dts
70 done 88 done
71} 89}