diff options
| author | Patrick Ohly <patrick.ohly@intel.com> | 2015-09-09 17:12:05 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-12 22:48:44 +0100 |
| commit | 2a05181d98b2966e7b6cc5fa79de44d6b863693b (patch) | |
| tree | 39833ad90af6b38edb5bae3efa0e319411b516c4 | |
| parent | c2165c97411c11949c65954568818d6ea9aca052 (diff) | |
| download | poky-2a05181d98b2966e7b6cc5fa79de44d6b863693b.tar.gz | |
runqemu: avoid image file name mismatches
Giving anything with -image in it as bootparams or in qemuparams (for
example, an additional -drive parameter with an image file or an
"-initrd .../core-image-minimal-initramfs-qemux86.cpio.gz") caused
runqemu to treat these parameters as names of the rootfs image file.
Matching *-image) after checking the current argument for more
specific cases like bootparams and qemuparams avoids this
misinterpretation of the command line parameters.
(From OE-Core rev: 29e0aaa7345ca823bb4af2d4a870e98ac75e04e7)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | scripts/runqemu | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index f16af9ccf4..23cf5be169 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -118,22 +118,6 @@ while true; do | |||
| 118 | [ -z "$FSTYPE" -o "$FSTYPE" = "$arg" ] && FSTYPE=$arg || \ | 118 | [ -z "$FSTYPE" -o "$FSTYPE" = "$arg" ] && FSTYPE=$arg || \ |
| 119 | error "conflicting FSTYPE types [$FSTYPE] and [$arg]" | 119 | error "conflicting FSTYPE types [$FSTYPE] and [$arg]" |
| 120 | ;; | 120 | ;; |
| 121 | *-image*) | ||
| 122 | [ -z "$ROOTFS" ] || \ | ||
| 123 | error "conflicting ROOTFS args [$ROOTFS] and [$arg]" | ||
| 124 | if [ -f "$arg" ]; then | ||
| 125 | process_filename $arg | ||
| 126 | elif [ -d "$arg" ]; then | ||
| 127 | # Handle the case where the nfsroot dir has -image- | ||
| 128 | # in the pathname | ||
| 129 | echo "Assuming $arg is an nfs rootfs" | ||
| 130 | FSTYPE=nfs | ||
| 131 | ROOTFS=$arg | ||
| 132 | else | ||
| 133 | ROOTFS=$arg | ||
| 134 | LAZY_ROOTFS="true" | ||
| 135 | fi | ||
| 136 | ;; | ||
| 137 | "ramfs") | 121 | "ramfs") |
| 138 | FSTYPE=cpio.gz | 122 | FSTYPE=cpio.gz |
| 139 | RAMFS=true | 123 | RAMFS=true |
| @@ -192,6 +176,22 @@ while true; do | |||
| 192 | "publicvnc") | 176 | "publicvnc") |
| 193 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -vnc 0.0.0.0:0" | 177 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -vnc 0.0.0.0:0" |
| 194 | ;; | 178 | ;; |
| 179 | *-image*) | ||
| 180 | [ -z "$ROOTFS" ] || \ | ||
| 181 | error "conflicting ROOTFS args [$ROOTFS] and [$arg]" | ||
| 182 | if [ -f "$arg" ]; then | ||
| 183 | process_filename $arg | ||
| 184 | elif [ -d "$arg" ]; then | ||
| 185 | # Handle the case where the nfsroot dir has -image- | ||
| 186 | # in the pathname | ||
| 187 | echo "Assuming $arg is an nfs rootfs" | ||
| 188 | FSTYPE=nfs | ||
| 189 | ROOTFS=$arg | ||
| 190 | else | ||
| 191 | ROOTFS=$arg | ||
| 192 | LAZY_ROOTFS="true" | ||
| 193 | fi | ||
| 194 | ;; | ||
| 195 | "") break ;; | 195 | "") break ;; |
| 196 | *) | 196 | *) |
| 197 | # A directory name is an nfs rootfs | 197 | # A directory name is an nfs rootfs |
