<div dir="ltr">Doesn't actually work if DEVICE_TREE is not set but QB_DTB is:<br><br>Traceback (most recent call last):<br> File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu", line 1277, in main<br> config.check_and_set()<br> File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu", line 692, in check_and_set<br> self.check_dtb()<br> File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/scripts/runqemu", line 624, in check_dtb<br> cmd_match = "%s/%s" % (deploy_dir_image, dtb)<br>NameError: name 'deploy_dir_image' 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"><<a href="mailto:alistair.francis@xilinx.com" target="_blank">alistair.francis@xilinx.com</a>></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 'none' for the kernel but still wants a device tree.<br>
<br>
Signed-off-by: Alistair Francis <<a href="mailto:alistair.francis@xilinx.com">alistair.francis@xilinx.com</a>><br>
Reviewed-by: Ben Levinsky <<a href="mailto:ben.levinsky@xilinx.com">ben.levinsky@xilinx.com</a>><br>
Cc: Ben Levinsky <<a href="mailto:ben.levinsky@xilinx.com">ben.levinsky@xilinx.com</a>><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 = ('MACHINE',<br>
'ROOTFS',<br>
'KERNEL',<br>
+ 'DEVICE_TREE',<br>
'DEPLOY_DIR_IMAGE',<br>
'OE_TMPDIR',<br>
'OECORE_NATIVE_SYSROOT',<br>
@@ -579,7 +581,7 @@ class BaseConfig(object):<br>
raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)<br>
<br>
def check_kernel(self):<br>
- """Check and set kernel, dtb"""<br>
+ """Check and set kernel"""<br>
# The vm image doesn'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("KERNEL %s not found" % self.kernel)<br>
<br>
+ def check_dtb(self):<br>
+ """Check and set dtb"""<br>
+ # Did the user specify a device tree?<br>
+ if self.get('DEVICE_TREE'):<br>
+ self.dtb = self.get('DEVICE_TREE')<br>
+ if not os.path.exists(self.dtb):<br>
+ raise RunQemuError('Specified DTB not found: %s' % self.dtb)<br>
+ return<br>
+<br>
dtb = self.get('QB_DTB')<br>
if dtb:<br>
cmd_match = "%s/%s" % (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>