mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
7159b281e7
commit
fae2e2f42d
+14
-1
@@ -69,6 +69,7 @@ Usage: you can run this script with any valid combination
|
|||||||
of the following environment variables (in any order):
|
of the following environment variables (in any order):
|
||||||
KERNEL - the kernel image file to use
|
KERNEL - the kernel image file to use
|
||||||
ROOTFS - the rootfs image file or nfsroot directory to use
|
ROOTFS - the rootfs image file or nfsroot directory to use
|
||||||
|
DEVICE_TREE - the device tree blob to use
|
||||||
MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
|
MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
|
||||||
Simplified QEMU command-line options can be passed with:
|
Simplified QEMU command-line options can be passed with:
|
||||||
nographic - disable video console
|
nographic - disable video console
|
||||||
@@ -178,6 +179,7 @@ class BaseConfig(object):
|
|||||||
self.env_vars = ('MACHINE',
|
self.env_vars = ('MACHINE',
|
||||||
'ROOTFS',
|
'ROOTFS',
|
||||||
'KERNEL',
|
'KERNEL',
|
||||||
|
'DEVICE_TREE',
|
||||||
'DEPLOY_DIR_IMAGE',
|
'DEPLOY_DIR_IMAGE',
|
||||||
'OE_TMPDIR',
|
'OE_TMPDIR',
|
||||||
'OECORE_NATIVE_SYSROOT',
|
'OECORE_NATIVE_SYSROOT',
|
||||||
@@ -579,7 +581,7 @@ class BaseConfig(object):
|
|||||||
raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
|
raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
|
||||||
|
|
||||||
def check_kernel(self):
|
def check_kernel(self):
|
||||||
"""Check and set kernel, dtb"""
|
"""Check and set kernel"""
|
||||||
# The vm image doesn't need a kernel
|
# The vm image doesn't need a kernel
|
||||||
if self.fstype in self.vmtypes:
|
if self.fstype in self.vmtypes:
|
||||||
return
|
return
|
||||||
@@ -608,8 +610,18 @@ class BaseConfig(object):
|
|||||||
if not os.path.exists(self.kernel):
|
if not os.path.exists(self.kernel):
|
||||||
raise RunQemuError("KERNEL %s not found" % self.kernel)
|
raise RunQemuError("KERNEL %s not found" % self.kernel)
|
||||||
|
|
||||||
|
def check_dtb(self):
|
||||||
|
"""Check and set dtb"""
|
||||||
|
# Did the user specify a device tree?
|
||||||
|
if self.get('DEVICE_TREE'):
|
||||||
|
self.dtb = self.get('DEVICE_TREE')
|
||||||
|
if not os.path.exists(self.dtb):
|
||||||
|
raise RunQemuError('Specified DTB not found: %s' % self.dtb)
|
||||||
|
return
|
||||||
|
|
||||||
dtb = self.get('QB_DTB')
|
dtb = self.get('QB_DTB')
|
||||||
if dtb:
|
if dtb:
|
||||||
|
deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
|
||||||
cmd_match = "%s/%s" % (deploy_dir_image, dtb)
|
cmd_match = "%s/%s" % (deploy_dir_image, dtb)
|
||||||
cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb)
|
cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb)
|
||||||
cmd_wild = "%s/*.dtb" % deploy_dir_image
|
cmd_wild = "%s/*.dtb" % deploy_dir_image
|
||||||
@@ -678,6 +690,7 @@ class BaseConfig(object):
|
|||||||
self.check_rootfs()
|
self.check_rootfs()
|
||||||
self.check_ovmf()
|
self.check_ovmf()
|
||||||
self.check_kernel()
|
self.check_kernel()
|
||||||
|
self.check_dtb()
|
||||||
self.check_biosdir()
|
self.check_biosdir()
|
||||||
self.check_mem()
|
self.check_mem()
|
||||||
self.check_tcpserial()
|
self.check_tcpserial()
|
||||||
|
|||||||
Reference in New Issue
Block a user