From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: openembedded-core@openembedded.org
Subject: [PATCH 3/6] runqemu: simplify process_filename()
Date: Thu, 3 May 2012 19:12:31 +0200 [thread overview]
Message-ID: <1336065154-8513-3-git-send-email-rep.dot.nop@gmail.com> (raw)
In-Reply-To: <1336065154-8513-1-git-send-email-rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
scripts/runqemu | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index 18fd691..dfa7f4b 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
--
1.7.10
next prev parent reply other threads:[~2012-05-03 17:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 17:12 [PATCH 1/6] runqemu: Use OE_TMPDIR Bernhard Reutner-Fischer
2012-05-03 17:12 ` [PATCH 2/6] runqemu: use modern, single-char name of test(1) Bernhard Reutner-Fischer
2012-05-07 23:25 ` Joshua Lock
2012-05-15 19:59 ` Bernhard Reutner-Fischer
2012-05-15 20:58 ` Khem Raj
2012-05-15 22:03 ` Peter Seebach
2012-05-03 17:12 ` Bernhard Reutner-Fischer [this message]
2012-05-03 17:12 ` [PATCH 4/6] runqemu: add and use error() Bernhard Reutner-Fischer
2012-05-03 17:12 ` [PATCH 5/6] runqemu: minor tweaks Bernhard Reutner-Fischer
2012-05-03 17:12 ` [PATCH 6/6] runqemu: be sh neutral Bernhard Reutner-Fischer
2012-05-04 21:18 ` [PATCH 1/6] runqemu: Use OE_TMPDIR Scott Garman
2012-05-07 23:56 ` Scott Garman
2012-05-08 7:07 ` Peter Seebach
2012-05-14 22:34 ` Mark Hatle
2012-05-14 22:40 ` Khem Raj
2012-05-14 22:51 ` Marko Lindqvist
2012-05-14 23:15 ` Mark Hatle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336065154-8513-3-git-send-email-rep.dot.nop@gmail.com \
--to=rep.dot.nop@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=openembedded-core@openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.