[oe-commits] Ricardo Neri : runqemu: Add option for custom BIOS directory

git at git.openembedded.org git at git.openembedded.org
Fri Mar 21 11:58:41 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: d302f5683dd736ac4cd4b601a046d22000d41e68
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d302f5683dd736ac4cd4b601a046d22000d41e68

Author: Ricardo Neri <ricardo.neri-calderon at linux.intel.com>
Date:   Thu Mar 20 12:35:33 2014 -0700

runqemu: Add option for custom BIOS directory

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 at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/runqemu | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index 573def1..e270274 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -150,6 +150,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=}"
 
@@ -484,5 +487,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 $?



More information about the Openembedded-commits mailing list