summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@xilinx.com>2017-11-21 16:43:57 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-02 11:25:34 +0000
commitfae2e2f42de8212e90f75ac0035ffb65db10bb6c (patch)
tree731e385ce06dbc96461853d2ae156d4cb9e48f3a /scripts
parent7159b281e7c2ec235034205d4dae664c87a9afca (diff)
downloadpoky-fae2e2f42de8212e90f75ac0035ffb65db10bb6c.tar.gz
runqemu: Allow the user to override the device tree option
Update the runqemu script to allow the user to specify a device tree to boot when calling runqemu. This involves creating a seperate check_dtb() function incase the user has specified 'none' for the kernel but still wants a device tree. (From OE-Core rev: 867ac1370b294bfd1ee31f94abb63688f77081a1) Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Ben Levinsky <ben.levinsky@xilinx.com> Cc: Ben Levinsky <ben.levinsky@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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()