summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-11-22 01:26:32 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-19 22:45:42 +0000
commit68c7589b67a83977331a04356b53aa51680a1d9d (patch)
tree01c4466acc31bb84e25cea3876e58101e7cfc6bf /scripts
parent3e1d8e5c7ac3238eda85ee95dfef044bef2a6411 (diff)
downloadopenembedded-core-68c7589b67a83977331a04356b53aa51680a1d9d.tar.gz
openembedded-core-68c7589b67a83977331a04356b53aa51680a1d9d.tar.bz2
openembedded-core-68c7589b67a83977331a04356b53aa51680a1d9d.zip
scripts/runqemu: fix checking for <file>.cpio.gz
When "runqemu /path/to/<file>.cpio.gz", it used the last suffix "gz" as the fstype which was wrong. Check filename against self.fstypes firstly can fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu22
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 83ec337e14..434b1c2ec7 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -269,19 +269,29 @@ class BaseConfig(object):
self.kernel = p
elif os.path.exists(p) and (not os.path.isdir(p)) and re.search('-image-', os.path.basename(p)):
self.rootfs = p
- dirpath = os.path.dirname(p)
- m = re.search('(.*)\.(.*)$', p)
- if m:
- qb = '%s%s' % (re.sub('\.rootfs$', '', m.group(1)), '.qemuboot.conf')
+ # Check filename against self.fstypes can hanlde <file>.cpio.gz,
+ # otherwise, its type would be "gz", which is incorrect.
+ fst = ""
+ for t in self.fstypes:
+ if p.endswith(t):
+ fst = t
+ break
+ if not fst:
+ m = re.search('.*\.(.*)$', self.rootfs)
+ if m:
+ fst = m.group(1)
+ if fst:
+ self.check_arg_fstype(fst)
+ qb = re.sub('\.' + fst + "$", '', self.rootfs)
+ qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf')
if os.path.exists(qb):
self.qemuboot = qb
self.qbconfload = True
else:
logger.warn("%s doesn't exist" % qb)
- fst = m.group(2)
- self.check_arg_fstype(fst)
else:
raise Exception("Can't find FSTYPE from: %s" % p)
+
elif os.path.isdir(p) or re.search(':', arg) and re.search('/', arg):
if self.is_deploy_dir_image(p):
logger.info('DEPLOY_DIR_IMAGE: %s' % p)