diff options
author | Scott Garman <scott.a.garman@intel.com> | 2010-10-11 13:12:51 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-11 22:24:23 +0100 |
commit | 364aaa6dfa706a6fe4afc85b5688a02daab75b26 (patch) | |
tree | 799eaa9d5f0925b5e97ecfb107a5d26aa968a530 /scripts | |
parent | cecd1bdf6f2680960909d1f0535d1606d04938c1 (diff) | |
download | poky-364aaa6dfa706a6fe4afc85b5688a02daab75b26.tar.gz |
poky-qemu: fix for handling full path to rootfs
This fixes [BUGID #427]
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/poky-qemu | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu index 4ce9e31a6b..66e7a298f6 100755 --- a/scripts/poky-qemu +++ b/scripts/poky-qemu | |||
@@ -74,8 +74,12 @@ while [ $i -le $# ]; do | |||
74 | ;; | 74 | ;; |
75 | *-image-*) | 75 | *-image-*) |
76 | if [ -z "$ROOTFS" ]; then | 76 | if [ -z "$ROOTFS" ]; then |
77 | ROOTFS=$arg | 77 | if [ -e "$arg" ]; then |
78 | LAZY_ROOTFS="true" | 78 | ROOTFS=$arg |
79 | else | ||
80 | ROOTFS=$arg | ||
81 | LAZY_ROOTFS="true" | ||
82 | fi | ||
79 | else | 83 | else |
80 | echo "Error: conflicting ROOTFS args [$ROOTFS] and [$arg]" | 84 | echo "Error: conflicting ROOTFS args [$ROOTFS] and [$arg]" |
81 | usage | 85 | usage |
@@ -159,6 +163,19 @@ fi | |||
159 | machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'` | 163 | machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'` |
160 | # MACHINE is now set for all cases | 164 | # MACHINE is now set for all cases |
161 | 165 | ||
166 | if [[ -e "$ROOTFS" && -z "$FSTYPE" ]]; then | ||
167 | # Extract the filename extension | ||
168 | EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'` | ||
169 | if [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" || | ||
170 | "x$EXT" == "xjffs2" ]]; then | ||
171 | FSTYPE=$EXT | ||
172 | else | ||
173 | echo "Note: Unable to determine filesystem extension for $ROOTFS" | ||
174 | echo "We will use the default FSTYPE for $MACHINE" | ||
175 | # ...which is done further below... | ||
176 | fi | ||
177 | fi | ||
178 | |||
162 | # Defaults used when these vars need to be inferred | 179 | # Defaults used when these vars need to be inferred |
163 | QEMUX86_DEFAULT_KERNEL=bzImage-qemux86.bin | 180 | QEMUX86_DEFAULT_KERNEL=bzImage-qemux86.bin |
164 | QEMUX86_DEFAULT_FSTYPE=ext3 | 181 | QEMUX86_DEFAULT_FSTYPE=ext3 |