Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] runqemu: Add option for custom BIOS directory
@ 2014-03-20 19:35 Ricardo Neri
  2014-03-31 16:48 ` Ricardo Neri
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Neri @ 2014-03-20 19:35 UTC (permalink / raw)
  To: Richard Purdie, Saul Wold; +Cc: openembedded-core

Add support to specify a directory for custom BIOS, VGA BIOS and
keymaps as supported by qemu (-L option). Even though this can be
done through qemuparams, having this option provides better user
experience by not having to specify a long and cluttered path along
with other qemuparams that the user might want to specify.

This new options assumes first that the path provided is relative to
OECORE_NATIVE_SYSROOT and will check whether it exists before proceeding.
If not, it will treat the provided path as absolute. This provides
the user flexibility to use BIOS binaries generated inside or outside
the OE build environment.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
---
 scripts/runqemu | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index 619ffb6..b1d2d1a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -149,6 +149,9 @@ while true; do
             SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
             SERIALSTDIO="1"
             ;;
+	"biosdir="*)
+            CUSTOMBIOSDIR="${arg##biosdir=}"
+	    ;;
         "qemuparams="*)
             SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
 
@@ -489,5 +492,21 @@ if [ ! -f "$INTERNAL_SCRIPT" -o ! -r "$INTERNAL_SCRIPT" ]; then
 INTERNAL_SCRIPT=`which runqemu-internal`
 fi
 
+# Specify directory for BIOS, VGA BIOS and keymaps
+if [ ! -z "$CUSTOMBIOSDIR" ]; then
+    if [ -d "$OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR" ]; then
+        echo "Assuming biosdir is $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+    else
+        if [ ! -d "$CUSTOMBIOSDIR" ]; then
+            echo "Custom BIOS directory not found. Tried: $CUSTOMBIOSDIR"
+            echo "and $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+            exit 1;
+        fi
+        echo "Assuming biosdir is $CUSTOMBIOSDIR"
+        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $CUSTOMBIOSDIR"
+    fi
+fi
+
 . $INTERNAL_SCRIPT
 exit $?
-- 
1.8.1.2



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

* Re: [PATCH v2] runqemu: Add option for custom BIOS directory
  2014-03-20 19:35 [PATCH v2] runqemu: Add option for custom BIOS directory Ricardo Neri
@ 2014-03-31 16:48 ` Ricardo Neri
  2014-03-31 16:59   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Neri @ 2014-03-31 16:48 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Thu, 2014-03-20 at 12:35 -0700, Ricardo Neri wrote:
> Add support to specify a directory for custom BIOS, VGA BIOS and
> keymaps as supported by qemu (-L option). Even though this can be
> done through qemuparams, having this option provides better user
> experience by not having to specify a long and cluttered path along
> with other qemuparams that the user might want to specify.
> 
> This new options assumes first that the path provided is relative to
> OECORE_NATIVE_SYSROOT and will check whether it exists before proceeding.
> If not, it will treat the provided path as absolute. This provides
> the user flexibility to use BIOS binaries generated inside or outside
> the OE build environment.
> 
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
> ---
>  scripts/runqemu | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 619ffb6..b1d2d1a 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -149,6 +149,9 @@ while true; do
>              SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
>              SERIALSTDIO="1"
>              ;;
> +	"biosdir="*)
> +            CUSTOMBIOSDIR="${arg##biosdir=}"
> +	    ;;
>          "qemuparams="*)
>              SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
>  
> @@ -489,5 +492,21 @@ if [ ! -f "$INTERNAL_SCRIPT" -o ! -r "$INTERNAL_SCRIPT" ]; then
>  INTERNAL_SCRIPT=`which runqemu-internal`
>  fi
>  
> +# Specify directory for BIOS, VGA BIOS and keymaps
> +if [ ! -z "$CUSTOMBIOSDIR" ]; then
> +    if [ -d "$OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR" ]; then
> +        echo "Assuming biosdir is $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
> +        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
> +    else
> +        if [ ! -d "$CUSTOMBIOSDIR" ]; then
> +            echo "Custom BIOS directory not found. Tried: $CUSTOMBIOSDIR"
> +            echo "and $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
> +            exit 1;
> +        fi
> +        echo "Assuming biosdir is $CUSTOMBIOSDIR"
> +        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $CUSTOMBIOSDIR"
> +    fi
> +fi
> +
>  . $INTERNAL_SCRIPT
>  exit $?

Hi!

I just wanted to check if there are comments about this patch.

BR,
Ricardo




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

* Re: [PATCH v2] runqemu: Add option for custom BIOS directory
  2014-03-31 16:48 ` Ricardo Neri
@ 2014-03-31 16:59   ` Richard Purdie
  2014-04-02 23:13     ` Ricardo Neri
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2014-03-31 16:59 UTC (permalink / raw)
  To: Ricardo Neri; +Cc: openembedded-core

On Mon, 2014-03-31 at 09:48 -0700, Ricardo Neri wrote:
> I just wanted to check if there are comments about this patch.

It merged 10 days ago:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=68acafd7dc18f23707c95c90e871395ded81f84b

Cheers,

Richard



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

* Re: [PATCH v2] runqemu: Add option for custom BIOS directory
  2014-03-31 16:59   ` Richard Purdie
@ 2014-04-02 23:13     ` Ricardo Neri
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Neri @ 2014-04-02 23:13 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core


On Mon, 2014-03-31 at 17:59 +0100, Richard Purdie wrote:
> On Mon, 2014-03-31 at 09:48 -0700, Ricardo Neri wrote:
> > I just wanted to check if there are comments about this patch.
> 
> It merged 10 days ago:
> 
> http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=68acafd7dc18f23707c95c90e871395ded81f84b

Oh great! Thanks Richard!
> 
> Cheers,
> 
> Richard
> 




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

end of thread, other threads:[~2014-04-02 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 19:35 [PATCH v2] runqemu: Add option for custom BIOS directory Ricardo Neri
2014-03-31 16:48 ` Ricardo Neri
2014-03-31 16:59   ` Richard Purdie
2014-04-02 23:13     ` Ricardo Neri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox