All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] runqemu: Allow the user to override the Kernel option
@ 2017-09-26 23:15 Alistair Francis
  2017-09-26 23:15 ` [PATCH 2/2] runqemu: Allow the user to override the device tree option Alistair Francis
  0 siblings, 1 reply; 3+ messages in thread
From: Alistair Francis @ 2017-09-26 23:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ben Levinsky

Update the runqemu script to allow the user to specify a Kernel to boot
when calling runqemu.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Cc: Ben Levinsky <ben.levinsky@xilinx.com>
---
 scripts/runqemu | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index df76270904..c3719a86f7 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -584,11 +584,15 @@ class BaseConfig(object):
         if self.fstype in self.vmtypes:
             return
 
+        # See if the user supplied a KERNEL option
+        if self.get('KERNEL'):
+            self.kernel = self.get('KERNEL')
+
         # QB_DEFAULT_KERNEL is always a full file path
         kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
 
         # The user didn't want a kernel to be loaded
-        if kernel_name == "none":
+        if kernel_name == "none" and not self.kernel:
             return
 
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] runqemu: Allow the user to override the device tree option
  2017-09-26 23:15 [PATCH 1/2] runqemu: Allow the user to override the Kernel option Alistair Francis
@ 2017-09-26 23:15 ` Alistair Francis
  2017-09-26 23:23   ` Alistair Francis
  0 siblings, 1 reply; 3+ messages in thread
From: Alistair Francis @ 2017-09-26 23:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ben Levinsky

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.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Cc: Ben Levinsky <ben.levinsky@xilinx.com>
---
 scripts/runqemu | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index c3719a86f7..45722a18ef 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -178,6 +178,7 @@ class BaseConfig(object):
         self.env_vars = ('MACHINE',
                         'ROOTFS',
                         'KERNEL',
+                        'DEVICE_TREE',
                         'DEPLOY_DIR_IMAGE',
                         'OE_TMPDIR',
                         'OECORE_NATIVE_SYSROOT',
@@ -579,7 +580,7 @@ class BaseConfig(object):
                 raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
 
     def check_kernel(self):
-        """Check and set kernel, dtb"""
+        """Check and set kernel"""
         # The vm image doesn't need a kernel
         if self.fstype in self.vmtypes:
             return
@@ -608,6 +609,15 @@ class BaseConfig(object):
         if not os.path.exists(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')
         if dtb:
             cmd_match = "%s/%s" % (deploy_dir_image, dtb)
@@ -678,6 +688,7 @@ class BaseConfig(object):
         self.check_rootfs()
         self.check_ovmf()
         self.check_kernel()
+        self.check_dtb()
         self.check_biosdir()
         self.check_mem()
         self.check_tcpserial()
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] runqemu: Allow the user to override the device tree option
  2017-09-26 23:15 ` [PATCH 2/2] runqemu: Allow the user to override the device tree option Alistair Francis
@ 2017-09-26 23:23   ` Alistair Francis
  0 siblings, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2017-09-26 23:23 UTC (permalink / raw)
  To: Alistair Francis; +Cc: Ben Levinsky, OE-core

On Tue, Sep 26, 2017 at 4:15 PM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> 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.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Cc: Ben Levinsky <ben.levinsky@xilinx.com>
> ---
>  scripts/runqemu | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index c3719a86f7..45722a18ef 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -178,6 +178,7 @@ class BaseConfig(object):
>          self.env_vars = ('MACHINE',
>                          'ROOTFS',
>                          'KERNEL',
> +                        'DEVICE_TREE',

Ah, I forgot to update the help information. I'll do that in v2.

Thanks,
Alistair

>                          'DEPLOY_DIR_IMAGE',
>                          'OE_TMPDIR',
>                          'OECORE_NATIVE_SYSROOT',
> @@ -579,7 +580,7 @@ class BaseConfig(object):
>                  raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
>
>      def check_kernel(self):
> -        """Check and set kernel, dtb"""
> +        """Check and set kernel"""
>          # The vm image doesn't need a kernel
>          if self.fstype in self.vmtypes:
>              return
> @@ -608,6 +609,15 @@ class BaseConfig(object):
>          if not os.path.exists(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')
>          if dtb:
>              cmd_match = "%s/%s" % (deploy_dir_image, dtb)
> @@ -678,6 +688,7 @@ class BaseConfig(object):
>          self.check_rootfs()
>          self.check_ovmf()
>          self.check_kernel()
> +        self.check_dtb()
>          self.check_biosdir()
>          self.check_mem()
>          self.check_tcpserial()
> --
> 2.11.0
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-27  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 23:15 [PATCH 1/2] runqemu: Allow the user to override the Kernel option Alistair Francis
2017-09-26 23:15 ` [PATCH 2/2] runqemu: Allow the user to override the device tree option Alistair Francis
2017-09-26 23:23   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.