summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2010-10-11 13:12:51 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-11 22:24:23 +0100
commit364aaa6dfa706a6fe4afc85b5688a02daab75b26 (patch)
tree799eaa9d5f0925b5e97ecfb107a5d26aa968a530 /scripts
parentcecd1bdf6f2680960909d1f0535d1606d04938c1 (diff)
downloadopenembedded-core-364aaa6dfa706a6fe4afc85b5688a02daab75b26.tar.gz
openembedded-core-364aaa6dfa706a6fe4afc85b5688a02daab75b26.tar.bz2
openembedded-core-364aaa6dfa706a6fe4afc85b5688a02daab75b26.tar.xz
openembedded-core-364aaa6dfa706a6fe4afc85b5688a02daab75b26.zip
poky-qemu: fix for handling full path to rootfs
This fixes [BUGID #427] Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/poky-qemu21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index 4ce9e31a6..66e7a298f 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -74,8 +74,12 @@ while [ $i -le $# ]; do
;;
*-image-*)
if [ -z "$ROOTFS" ]; then
- ROOTFS=$arg
- LAZY_ROOTFS="true"
+ if [ -e "$arg" ]; then
+ ROOTFS=$arg
+ else
+ ROOTFS=$arg
+ LAZY_ROOTFS="true"
+ fi
else
echo "Error: conflicting ROOTFS args [$ROOTFS] and [$arg]"
usage
@@ -159,6 +163,19 @@ fi
machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'`
# MACHINE is now set for all cases
+if [[ -e "$ROOTFS" && -z "$FSTYPE" ]]; then
+ # Extract the filename extension
+ EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'`
+ if [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" ||
+ "x$EXT" == "xjffs2" ]]; then
+ FSTYPE=$EXT
+ else
+ echo "Note: Unable to determine filesystem extension for $ROOTFS"
+ echo "We will use the default FSTYPE for $MACHINE"
+ # ...which is done further below...
+ fi
+fi
+
# Defaults used when these vars need to be inferred
QEMUX86_DEFAULT_KERNEL=bzImage-qemux86.bin
QEMUX86_DEFAULT_FSTYPE=ext3