aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-09-18 00:39:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-19 09:07:06 +0100
commitca5a686c6e165a51f95cb6a834cd53f6f66d42d4 (patch)
tree7bf4a05d734d9b98ade1889ad303868812f62283
parent3ccbaaad75f0a53d8bcf6a5c748ec80c96a383bd (diff)
downloadopenembedded-core-contrib-ca5a686c6e165a51f95cb6a834cd53f6f66d42d4.tar.gz
openembedded-core-contrib-ca5a686c6e165a51f95cb6a834cd53f6f66d42d4.tar.bz2
openembedded-core-contrib-ca5a686c6e165a51f95cb6a834cd53f6f66d42d4.zip
runqemu: try symlinks when kernel or rootfs can't be found
If the kernel or rootfs names written to the qemuboot.conf can't be found, try and find the symlinked variant of the filename. This will help usability of runqemu, for example where a user downloads an image and associated files as the symlinked names yet the qemuboot.conf variables point to the full, non-linked, file names. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 09fe7ceafdc..3e4e3ff8e2e 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -451,7 +451,12 @@ class BaseConfig(object):
if all_files:
self.rootfs = all_files[0]
else:
- raise Exception("Failed to find rootfs: %s" % cmd)
+ cmd = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype)
+ all_files = glob.glob(cmd)
+ if all_files:
+ self.rootfs = all_files[0]
+ else:
+ raise Exception("Failed to find rootfs: %s" % cmd)
if not os.path.exists(self.rootfs):
raise Exception("Can't find rootfs: %s" % self.rootfs)
@@ -462,13 +467,18 @@ class BaseConfig(object):
if self.fstype in self.vmtypes:
return
kernel = self.kernel
+ deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
if not kernel:
- kernel = "%s/%s" % (self.get('DEPLOY_DIR_IMAGE'), self.get('QB_DEFAULT_KERNEL'))
+ kernel = "%s/%s" % (deploy_dir_image, self.get('QB_DEFAULT_KERNEL'))
if os.path.exists(kernel):
self.kernel = kernel
else:
- raise Exception("KERNEL %s not found" % kernel)
+ kernel = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
+ if kernel != deploy_dir_image and os.path.exists(kernel):
+ self.kernel = kernel
+ else:
+ raise Exception("KERNEL %s not found" % kernel)
dtb = self.get('QB_DTB')
if dtb: