From d5e7fc117248d49728ae9f523db9ccc5b2b9a986 Mon Sep 17 00:00:00 2001 From: Scott Garman Date: Mon, 11 Oct 2010 13:12:51 -0700 Subject: [PATCH] poky-qemu: fix for handling full path to rootfs This fixes [BUGID #427] Signed-off-by: Scott Garman --- scripts/poky-qemu | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/poky-qemu b/scripts/poky-qemu index 4ce9e31..66e7a29 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 -- 2.7.4