summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-05-03 19:12:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-06 09:55:47 +0100
commit987bc36d137e46bc15ed424c3b813611d41e1886 (patch)
treefedfe06ef8bde1be6f2e558a32a9f7d454b15681 /scripts
parente99f652ede4612eec7cef5fa16638b07519cba8e (diff)
downloadpoky-987bc36d137e46bc15ed424c3b813611d41e1886.tar.gz
poky-987bc36d137e46bc15ed424c3b813611d41e1886.tar.bz2
poky-987bc36d137e46bc15ed424c3b813611d41e1886.zip
runqemu: simplify process_filename()
(From OE-Core rev: 042efbe653b699bd33175117e1363d87e4602e4f) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu47
1 files changed, 25 insertions, 22 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 18fd691873..dfa7f4bc2d 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -62,28 +62,31 @@ process_filename() {
# Extract the filename extension
EXT=`echo $filename | awk -F . '{ print \$NF }'`
- # A file ending in .bin is a kernel
- if [ "x$EXT" = "xbin" ]; then
- if [ -z "$KERNEL" ]; then
- KERNEL=$filename
- else
- echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]"
- usage
- fi
- elif [ "x$EXT" = "xext2" -o "x$EXT" = "xext3" -o \
- "x$EXT" = "xjffs2" -o "x$EXT" = "xbtrfs" ]; then
- # A file ending in a supportted fs type is a rootfs image
- if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then
- FSTYPE=$EXT
- ROOTFS=$filename
- else
- echo "Error: conflicting FSTYPE types [$FSTYPE] and [$EXT]"
- usage
- fi
- else
- echo "Error: unknown file arg [$filename]"
- usage
- fi
+ case /$EXT/ in
+ /bin/)
+ # A file ending in .bin is a kernel
+ if [ -z "$KERNEL" ]; then
+ KERNEL=$filename
+ else
+ echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]"
+ usage
+ fi
+ ;;
+ /ext[234]/|/jffs2/|/btrfs/)
+ # A file ending in a supportted fs type is a rootfs image
+ if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then
+ FSTYPE=$EXT
+ ROOTFS=$filename
+ else
+ echo "Error: conflicting FSTYPE types [$FSTYPE] and [$EXT]"
+ usage
+ fi
+ ;;
+ *)
+ echo "Error: unknown file arg [$filename]"
+ usage
+ ;;
+ esac
}
# Parse command line args without requiring specific ordering. It's a