]> code.ossystems Code Review - openembedded-core.git/commitdiff
poky-qemu: fix handling of some rootfs types
authorScott Garman <scott.a.garman@intel.com>
Fri, 8 Oct 2010 17:14:14 +0000 (10:14 -0700)
committerScott Garman <scott.a.garman@intel.com>
Fri, 8 Oct 2010 21:47:54 +0000 (14:47 -0700)
This allows the user to specify a rootfs type
(e.g, poky-image-sato) without typing out the full filename
and path (assuming we can infer a valid MACHINE and FSTYPE).

This fixes [BUGID #415]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
scripts/poky-qemu

index ad4bdbf91cb8dc34c47f4cd609b48c01d7e4f33e..4ce9e31a6bf8a4c2a9e3dd93afd06613bbf8a9e5 100755 (executable)
@@ -44,6 +44,7 @@ MACHINE=${MACHINE:=""}
 KERNEL=""
 FSTYPE=""
 ROOTFS=""
+LAZY_ROOTFS=""
 SCRIPT_QEMU_OPT=""
 SCRIPT_KERNEL_OPT=""
 
@@ -74,6 +75,7 @@ while [ $i -le $# ]; do
         *-image-*)
             if [ -z "$ROOTFS" ]; then
                 ROOTFS=$arg
+                LAZY_ROOTFS="true"
             else
                 echo "Error: conflicting ROOTFS args [$ROOTFS] and [$arg]"
                 usage
@@ -260,6 +262,14 @@ if [ -z "$FSTYPE" ]; then
 fi
 # FSTYPE is now set for all cases
 
+# Handle cases where a ROOTFS type is given instead of a filename, e.g.
+# poky-image-sato
+if [ "$LAZY_ROOTFS" = "true" ]; then
+    setup_tmpdir
+    echo "Assuming $ROOTFS really means $TMPDIR/deploy/images/$ROOTFS-$MACHINE.$FSTYPE"
+    ROOTFS=$TMPDIR/deploy/images/$ROOTFS-$MACHINE.$FSTYPE
+fi
+
 if [ -z "$ROOTFS" ]; then
     setup_tmpdir
     T=$TMPDIR/deploy/images