summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/runqemu15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 01d831520a..f2b4b3c09d 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -69,6 +69,7 @@ Usage: you can run this script with any valid combination
69of the following environment variables (in any order): 69of the following environment variables (in any order):
70 KERNEL - the kernel image file to use 70 KERNEL - the kernel image file to use
71 ROOTFS - the rootfs image file or nfsroot directory to use 71 ROOTFS - the rootfs image file or nfsroot directory to use
72 DEVICE_TREE - the device tree blob to use
72 MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified) 73 MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
73 Simplified QEMU command-line options can be passed with: 74 Simplified QEMU command-line options can be passed with:
74 nographic - disable video console 75 nographic - disable video console
@@ -178,6 +179,7 @@ class BaseConfig(object):
178 self.env_vars = ('MACHINE', 179 self.env_vars = ('MACHINE',
179 'ROOTFS', 180 'ROOTFS',
180 'KERNEL', 181 'KERNEL',
182 'DEVICE_TREE',
181 'DEPLOY_DIR_IMAGE', 183 'DEPLOY_DIR_IMAGE',
182 'OE_TMPDIR', 184 'OE_TMPDIR',
183 'OECORE_NATIVE_SYSROOT', 185 'OECORE_NATIVE_SYSROOT',
@@ -579,7 +581,7 @@ class BaseConfig(object):
579 raise RunQemuError("Can't find OVMF firmware: %s" % ovmf) 581 raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
580 582
581 def check_kernel(self): 583 def check_kernel(self):
582 """Check and set kernel, dtb""" 584 """Check and set kernel"""
583 # The vm image doesn't need a kernel 585 # The vm image doesn't need a kernel
584 if self.fstype in self.vmtypes: 586 if self.fstype in self.vmtypes:
585 return 587 return
@@ -608,8 +610,18 @@ class BaseConfig(object):
608 if not os.path.exists(self.kernel): 610 if not os.path.exists(self.kernel):
609 raise RunQemuError("KERNEL %s not found" % self.kernel) 611 raise RunQemuError("KERNEL %s not found" % self.kernel)
610 612
613 def check_dtb(self):
614 """Check and set dtb"""
615 # Did the user specify a device tree?
616 if self.get('DEVICE_TREE'):
617 self.dtb = self.get('DEVICE_TREE')
618 if not os.path.exists(self.dtb):
619 raise RunQemuError('Specified DTB not found: %s' % self.dtb)
620 return
621
611 dtb = self.get('QB_DTB') 622 dtb = self.get('QB_DTB')
612 if dtb: 623 if dtb:
624 deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
613 cmd_match = "%s/%s" % (deploy_dir_image, dtb) 625 cmd_match = "%s/%s" % (deploy_dir_image, dtb)
614 cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb) 626 cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb)
615 cmd_wild = "%s/*.dtb" % deploy_dir_image 627 cmd_wild = "%s/*.dtb" % deploy_dir_image
@@ -678,6 +690,7 @@ class BaseConfig(object):
678 self.check_rootfs() 690 self.check_rootfs()
679 self.check_ovmf() 691 self.check_ovmf()
680 self.check_kernel() 692 self.check_kernel()
693 self.check_dtb()
681 self.check_biosdir() 694 self.check_biosdir()
682 self.check_mem() 695 self.check_mem()
683 self.check_tcpserial() 696 self.check_tcpserial()