<div dir="ltr"><div><span class="gmail-stdout">Would this be the cause of this failure on the autobuilder when doing testimage?<br><br>runqemu - ERROR - DTB not found: tmp/deploy/images/qemuarm/zImage-versatile-pb.dtb, tmp/deploy/images/qemuarm/zImage-versatile-pb.dtb* or tmp/deploy/images/qemuarm/*.dtb</span></div><div><span class="gmail-stdout"><br></span></div><div><span class="gmail-stdout">From <a href="https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/463/steps/Running%20Sanity%20Tests/logs/stdio">https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/463/steps/Running%20Sanity%20Tests/logs/stdio</a><br></span></div><div><span class="gmail-stdout"><br></span></div><div><span class="gmail-stdout">Ross</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 September 2017 at 02:57, Otavio Salvador <span dir="ltr">&lt;<a href="mailto:otavio@ossystems.com.br" target="_blank">otavio@ossystems.com.br</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Device Tree is commonly used but it is still kept as a .inc file<br>
instead of a proper class. Instead now we move the Device Tree code to<br>
a kernel-devicetree class and automatically enable it when the<br>
KERNEL_DEVICETREE variable is set.<br>
<br>
To avoid breakage, we kept a linux-dtb.inc file which raises a warning<br>
telling the user about the change so in next release this can be<br>
removed.<br>
<br>
Signed-off-by: Otavio Salvador &lt;<a href="mailto:otavio@ossystems.com.br">otavio@ossystems.com.br</a>&gt;<br>
---<br>
<br>
 meta/classes/kernel-<wbr>devicetree.bbclass  | 63 ++++++++++++++++++++++++++++++<wbr>++<br>
 meta/classes/kernel.bbclass             |  4 +++<br>
 meta/recipes-kernel/linux/<wbr>linux-dtb.inc | 64 ++----------------------------<wbr>---<br>
 3 files changed, 69 insertions(+), 62 deletions(-)<br>
 create mode 100644 meta/classes/kernel-<wbr>devicetree.bbclass<br>
<br>
diff --git a/meta/classes/kernel-<wbr>devicetree.bbclass b/meta/classes/kernel-<wbr>devicetree.bbclass<br>
new file mode 100644<br>
index 0000000000..6e6f39e640<br>
--- /dev/null<br>
+++ b/meta/classes/kernel-<wbr>devicetree.bbclass<br>
@@ -0,0 +1,63 @@<br>
+# Support for device tree generation<br>
+FILES_kernel-devicetree = &quot;/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo&quot;<br>
+<br>
+python __anonymous () {<br>
+    d.appendVar(&quot;PACKAGES&quot;, &quot; kernel-devicetree&quot;)<br>
+}<br>
+<br>
+normalize_dtb () {<br>
+       DTB=&quot;$1&quot;<br>
+       if echo ${DTB} | grep -q &#39;/dts/&#39;; then<br>
+               bbwarn &quot;${DTB} contains the full path to the the dts file, but only the dtb name should be used.&quot;<br>
+               DTB=`basename ${DTB} | sed &#39;s,\.dts$,.dtb,g&#39;`<br>
+       fi<br>
+       echo &quot;${DTB}&quot;<br>
+}<br>
+<br>
+get_real_dtb_path_in_kernel () {<br>
+       DTB=&quot;$1&quot;<br>
+       DTB_PATH=&quot;${B}/arch/${ARCH}/<wbr>boot/dts/${DTB}&quot;<br>
+       if [ ! -e &quot;${DTB_PATH}&quot; ]; then<br>
+               DTB_PATH=&quot;${B}/arch/${ARCH}/<wbr>boot/${DTB}&quot;<br>
+       fi<br>
+       echo &quot;${DTB_PATH}&quot;<br>
+}<br>
+<br>
+do_compile_append() {<br>
+       for DTB in ${KERNEL_DEVICETREE}; do<br>
+               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
+               oe_runmake ${DTB}<br>
+       done<br>
+}<br>
+<br>
+do_install_append() {<br>
+       for DTB in ${KERNEL_DEVICETREE}; do<br>
+               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
+               DTB_EXT=${DTB##*.}<br>
+               DTB_PATH=`get_real_dtb_path_<wbr>in_kernel &quot;${DTB}&quot;`<br>
+               DTB_BASE_NAME=`basename ${DTB} .&quot;${DTB_EXT}&quot;`<br>
+               install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${<wbr>DTB_BASE_NAME}.${DTB_EXT}<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       symlink_name=${type}&quot;-&quot;${<wbr>KERNEL_IMAGE_SYMLINK_NAME}<br>
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
+                       ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/<wbr>devicetree-${DTB_SYMLINK_NAME}<wbr>.${DTB_EXT}<br>
+               done<br>
+       done<br>
+}<br>
+<br>
+do_deploy_append() {<br>
+       for DTB in ${KERNEL_DEVICETREE}; do<br>
+               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
+               DTB_EXT=${DTB##*.}<br>
+               DTB_BASE_NAME=`basename ${DTB} .&quot;${DTB_EXT}&quot;`<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       base_name=${type}&quot;-&quot;${KERNEL_<wbr>IMAGE_BASE_NAME}<br>
+                       symlink_name=${type}&quot;-&quot;${<wbr>KERNEL_IMAGE_SYMLINK_NAME}<br>
+                       DTB_NAME=`echo ${base_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
+                       DTB_PATH=`get_real_dtb_path_<wbr>in_kernel &quot;${DTB}&quot;`<br>
+                       install -d ${DEPLOYDIR}<br>
+                       install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${<wbr>DTB_EXT}<br>
+               done<br>
+       done<br>
+}<br>
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass<br>
index 02a5e961cb..8c01e90709 100644<br>
--- a/meta/classes/kernel.bbclass<br>
+++ b/meta/classes/kernel.bbclass<br>
@@ -662,3 +662,7 @@ do_deploy[prefuncs] += &quot;package_get_auto_pr&quot;<br>
 addtask deploy after do_populate_sysroot do_packagedata<br>
<br>
 EXPORT_FUNCTIONS do_deploy<br>
+<br>
+# If we are using Device Tree support, inherit the class to enable it<br>
+KERNEL_DEVICETREE_CLASS = &quot;${@[&#39;kernel-devicetree&#39;, &#39;&#39;][d.getVar(&#39;KERNEL_<wbr>DEVICETREE&#39;, False) == None]}&quot;<br>
+inherit ${KERNEL_DEVICETREE_CLASS}<br>
diff --git a/meta/recipes-kernel/linux/<wbr>linux-dtb.inc b/meta/recipes-kernel/linux/<wbr>linux-dtb.inc<br>
index 6e6f39e640..f1912775ca 100644<br>
--- a/meta/recipes-kernel/linux/<wbr>linux-dtb.inc<br>
+++ b/meta/recipes-kernel/linux/<wbr>linux-dtb.inc<br>
@@ -1,63 +1,3 @@<br>
-# Support for device tree generation<br>
-FILES_kernel-devicetree = &quot;/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo&quot;<br>
-<br>
-python __anonymous () {<br>
-    d.appendVar(&quot;PACKAGES&quot;, &quot; kernel-devicetree&quot;)<br>
-}<br>
-<br>
-normalize_dtb () {<br>
-       DTB=&quot;$1&quot;<br>
-       if echo ${DTB} | grep -q &#39;/dts/&#39;; then<br>
-               bbwarn &quot;${DTB} contains the full path to the the dts file, but only the dtb name should be used.&quot;<br>
-               DTB=`basename ${DTB} | sed &#39;s,\.dts$,.dtb,g&#39;`<br>
-       fi<br>
-       echo &quot;${DTB}&quot;<br>
-}<br>
-<br>
-get_real_dtb_path_in_kernel () {<br>
-       DTB=&quot;$1&quot;<br>
-       DTB_PATH=&quot;${B}/arch/${ARCH}/<wbr>boot/dts/${DTB}&quot;<br>
-       if [ ! -e &quot;${DTB_PATH}&quot; ]; then<br>
-               DTB_PATH=&quot;${B}/arch/${ARCH}/<wbr>boot/${DTB}&quot;<br>
-       fi<br>
-       echo &quot;${DTB_PATH}&quot;<br>
-}<br>
-<br>
-do_compile_append() {<br>
-       for DTB in ${KERNEL_DEVICETREE}; do<br>
-               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
-               oe_runmake ${DTB}<br>
-       done<br>
-}<br>
-<br>
-do_install_append() {<br>
-       for DTB in ${KERNEL_DEVICETREE}; do<br>
-               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
-               DTB_EXT=${DTB##*.}<br>
-               DTB_PATH=`get_real_dtb_path_<wbr>in_kernel &quot;${DTB}&quot;`<br>
-               DTB_BASE_NAME=`basename ${DTB} .&quot;${DTB_EXT}&quot;`<br>
-               install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${<wbr>DTB_BASE_NAME}.${DTB_EXT}<br>
-               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
-                       symlink_name=${type}&quot;-&quot;${<wbr>KERNEL_IMAGE_SYMLINK_NAME}<br>
-                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
-                       ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/<wbr>devicetree-${DTB_SYMLINK_NAME}<wbr>.${DTB_EXT}<br>
-               done<br>
-       done<br>
-}<br>
-<br>
-do_deploy_append() {<br>
-       for DTB in ${KERNEL_DEVICETREE}; do<br>
-               DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
-               DTB_EXT=${DTB##*.}<br>
-               DTB_BASE_NAME=`basename ${DTB} .&quot;${DTB_EXT}&quot;`<br>
-               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
-                       base_name=${type}&quot;-&quot;${KERNEL_<wbr>IMAGE_BASE_NAME}<br>
-                       symlink_name=${type}&quot;-&quot;${<wbr>KERNEL_IMAGE_SYMLINK_NAME}<br>
-                       DTB_NAME=`echo ${base_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
-                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}<wbr>/g&quot;`<br>
-                       DTB_PATH=`get_real_dtb_path_<wbr>in_kernel &quot;${DTB}&quot;`<br>
-                       install -d ${DEPLOYDIR}<br>
-                       install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${<wbr>DTB_EXT}<br>
-               done<br>
-       done<br>
+python() {<br>
+    bb.warn(&quot;You are using the linux-dtb.inc which is deprecated. You can safely remove it as the Device Tree support is automatically enabled when KERNEL_DEVICETREE is set.&quot;)<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.1<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>