diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-05-03 19:12:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-06 09:55:47 +0100 |
commit | 987bc36d137e46bc15ed424c3b813611d41e1886 (patch) | |
tree | fedfe06ef8bde1be6f2e558a32a9f7d454b15681 | |
parent | e99f652ede4612eec7cef5fa16638b07519cba8e (diff) | |
download | poky-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>
-rwxr-xr-x | scripts/runqemu | 47 |
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 |