summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
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/runqemu
parente99f652ede4612eec7cef5fa16638b07519cba8e (diff)
downloadpoky-987bc36d137e46bc15ed424c3b813611d41e1886.tar.gz
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/runqemu')
-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() {
62 62
63 # Extract the filename extension 63 # Extract the filename extension
64 EXT=`echo $filename | awk -F . '{ print \$NF }'` 64 EXT=`echo $filename | awk -F . '{ print \$NF }'`
65 # A file ending in .bin is a kernel 65 case /$EXT/ in
66 if [ "x$EXT" = "xbin" ]; then 66 /bin/)
67 if [ -z "$KERNEL" ]; then 67 # A file ending in .bin is a kernel
68 KERNEL=$filename 68 if [ -z "$KERNEL" ]; then
69 else 69 KERNEL=$filename
70 echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]" 70 else
71 usage 71 echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]"
72 fi 72 usage
73 elif [ "x$EXT" = "xext2" -o "x$EXT" = "xext3" -o \ 73 fi
74 "x$EXT" = "xjffs2" -o "x$EXT" = "xbtrfs" ]; then 74 ;;
75 # A file ending in a supportted fs type is a rootfs image 75 /ext[234]/|/jffs2/|/btrfs/)
76 if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then 76 # A file ending in a supportted fs type is a rootfs image
77 FSTYPE=$EXT 77 if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then
78 ROOTFS=$filename 78 FSTYPE=$EXT
79 else 79 ROOTFS=$filename
80 echo "Error: conflicting FSTYPE types [$FSTYPE] and [$EXT]" 80 else
81 usage 81 echo "Error: conflicting FSTYPE types [$FSTYPE] and [$EXT]"
82 fi 82 usage
83 else 83 fi
84 echo "Error: unknown file arg [$filename]" 84 ;;
85 usage 85 *)
86 fi 86 echo "Error: unknown file arg [$filename]"
87 usage
88 ;;
89 esac
87} 90}
88 91
89# Parse command line args without requiring specific ordering. It's a 92# Parse command line args without requiring specific ordering. It's a