<div dir="ltr">Doesn&#39;t actually work if DEVICE_TREE is not set but QB_DTB is:<br><br>Traceback (most recent call last):<br>  File &quot;/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu&quot;, line 1277, in main<br>    config.check_and_set()<br>  File &quot;/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu&quot;, line 692, in check_and_set<br>    self.check_dtb()<br>  File &quot;/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu&quot;, line 624, in check_dtb<br>    cmd_match = &quot;%s/%s&quot; % (deploy_dir_image, dtb)<br>NameError: name &#39;deploy_dir_image&#39; is not defined<br><div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 October 2017 at 00:32, Alistair Francis <span dir="ltr">&lt;<a href="mailto:alistair.francis@xilinx.com" target="_blank">alistair.francis@xilinx.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Update the runqemu script to allow the user to specify a device tree<br>
to boot when calling runqemu.<br>
<br>
This involves creating a seperate check_dtb() function incase the user<br>
has specified &#39;none&#39; for the kernel but still wants a device tree.<br>
<br>
Signed-off-by: Alistair Francis &lt;<a href="mailto:alistair.francis@xilinx.com">alistair.francis@xilinx.com</a>&gt;<br>
Reviewed-by: Ben Levinsky &lt;<a href="mailto:ben.levinsky@xilinx.com">ben.levinsky@xilinx.com</a>&gt;<br>
Cc: Ben Levinsky &lt;<a href="mailto:ben.levinsky@xilinx.com">ben.levinsky@xilinx.com</a>&gt;<br>
---<br>
 scripts/runqemu | 14 +++++++++++++-<br>
 1 file changed, 13 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/scripts/runqemu b/scripts/runqemu<br>
index c3719a86f7..1be6db0eea 100755<br>
--- a/scripts/runqemu<br>
+++ b/scripts/runqemu<br>
@@ -69,6 +69,7 @@ Usage: you can run this script with any valid combination<br>
 of the following environment variables (in any order):<br>
   KERNEL - the kernel image file to use<br>
   ROOTFS - the rootfs image file or nfsroot directory to use<br>
+  DEVICE_TREE - the device tree blob to use<br>
   MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)<br>
   Simplified QEMU command-line options can be passed with:<br>
     nographic - disable video console<br>
@@ -178,6 +179,7 @@ class BaseConfig(object):<br>
         self.env_vars = (&#39;MACHINE&#39;,<br>
                         &#39;ROOTFS&#39;,<br>
                         &#39;KERNEL&#39;,<br>
+                        &#39;DEVICE_TREE&#39;,<br>
                         &#39;DEPLOY_DIR_IMAGE&#39;,<br>
                         &#39;OE_TMPDIR&#39;,<br>
                         &#39;OECORE_NATIVE_SYSROOT&#39;,<br>
@@ -579,7 +581,7 @@ class BaseConfig(object):<br>
                 raise RunQemuError(&quot;Can&#39;t find OVMF firmware: %s&quot; % ovmf)<br>
<br>
     def check_kernel(self):<br>
-        &quot;&quot;&quot;Check and set kernel, dtb&quot;&quot;&quot;<br>
+        &quot;&quot;&quot;Check and set kernel&quot;&quot;&quot;<br>
         # The vm image doesn&#39;t need a kernel<br>
         if self.fstype in self.vmtypes:<br>
             return<br>
@@ -608,6 +610,15 @@ class BaseConfig(object):<br>
         if not os.path.exists(self.kernel):<br>
             raise RunQemuError(&quot;KERNEL %s not found&quot; % self.kernel)<br>
<br>
+    def check_dtb(self):<br>
+        &quot;&quot;&quot;Check and set dtb&quot;&quot;&quot;<br>
+        # Did the user specify a device tree?<br>
+        if self.get(&#39;DEVICE_TREE&#39;):<br>
+            self.dtb = self.get(&#39;DEVICE_TREE&#39;)<br>
+            if not os.path.exists(self.dtb):<br>
+                raise RunQemuError(&#39;Specified DTB not found: %s&#39; % self.dtb)<br>
+            return<br>
+<br>
         dtb = self.get(&#39;QB_DTB&#39;)<br>
         if dtb:<br>
             cmd_match = &quot;%s/%s&quot; % (deploy_dir_image, dtb)<br>
@@ -678,6 +689,7 @@ class BaseConfig(object):<br>
         self.check_rootfs()<br>
         self.check_ovmf()<br>
         self.check_kernel()<br>
+        self.check_dtb()<br>
         self.check_biosdir()<br>
         self.check_mem()<br>
         self.check_tcpserial()<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<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>