summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorJoshua Lock <joshuagloe@gmail.com>2016-09-05 21:32:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-09 12:07:32 +0100
commite162303ecb646b00de85b426113acbcfe0cc96c6 (patch)
tree7b71e2ce5b2ab6f705b77f97c4d218a6a69e5cdd /scripts/runqemu
parentb405712414de98cba3a645601419aceb32d52f02 (diff)
downloadpoky-e162303ecb646b00de85b426113acbcfe0cc96c6.tar.gz
runqemu: assume artefacts are relative to *.qemuboot.conf
When runqemu is started with a *.qemuboot.conf arg assume that image artefacts are relative to that file, rather than in whatever directory the DEPLOY_DIR_IMAGE variable in the conf file points to. (From OE-Core rev: a6448371b87f754def669adfdc01b07d18003405) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 7b0bcb24ee..5b719d5ac7 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -143,6 +143,7 @@ class BaseConfig(object):
143 self.nfs_server = '' 143 self.nfs_server = ''
144 self.rootfs = '' 144 self.rootfs = ''
145 self.qemuboot = '' 145 self.qemuboot = ''
146 self.qbconfload = False
146 self.kernel = '' 147 self.kernel = ''
147 self.kernel_cmdline = '' 148 self.kernel_cmdline = ''
148 self.kernel_cmdline_script = '' 149 self.kernel_cmdline_script = ''
@@ -239,6 +240,7 @@ class BaseConfig(object):
239 """ 240 """
240 if p.endswith('.qemuboot.conf'): 241 if p.endswith('.qemuboot.conf'):
241 self.qemuboot = p 242 self.qemuboot = p
243 self.qbconfload = True
242 elif re.search('\.bin$', p) or re.search('bzImage', p) or \ 244 elif re.search('\.bin$', p) or re.search('bzImage', p) or \
243 re.search('zImage', p) or re.search('vmlinux', p) or \ 245 re.search('zImage', p) or re.search('vmlinux', p) or \
244 re.search('fitImage', p) or re.search('uImage', p): 246 re.search('fitImage', p) or re.search('uImage', p):
@@ -250,7 +252,8 @@ class BaseConfig(object):
250 if m: 252 if m:
251 qb = '%s%s' % (re.sub('\.rootfs$', '', m.group(1)), '.qemuboot.conf') 253 qb = '%s%s' % (re.sub('\.rootfs$', '', m.group(1)), '.qemuboot.conf')
252 if os.path.exists(qb): 254 if os.path.exists(qb):
253 self.qemuboot = qb 255 self.qemuboot = qb
256 self.qbconfload = True
254 else: 257 else:
255 logger.warn("%s doesn't exist" % qb) 258 logger.warn("%s doesn't exist" % qb)
256 fst = m.group(2) 259 fst = m.group(2)
@@ -533,6 +536,7 @@ class BaseConfig(object):
533 qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') 536 qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
534 if qbs: 537 if qbs:
535 self.qemuboot = qbs.split()[0] 538 self.qemuboot = qbs.split()[0]
539 self.qbconfload = True
536 540
537 if not os.path.exists(self.qemuboot): 541 if not os.path.exists(self.qemuboot):
538 raise Exception("Failed to find <image>.qemuboot.conf!") 542 raise Exception("Failed to find <image>.qemuboot.conf!")
@@ -545,6 +549,15 @@ class BaseConfig(object):
545 k_upper = k.upper() 549 k_upper = k.upper()
546 self.set(k_upper, v) 550 self.set(k_upper, v)
547 551
552 # When we're started with a *.qemuboot.conf arg assume that image
553 # artefacts are relative to that file, rather than in whatever
554 # directory DEPLOY_DIR_IMAGE in the conf file points to.
555 if self.qbconfload:
556 imgdir = os.path.dirname(self.qemuboot)
557 if imgdir != self.get('DEPLOY_DIR_IMAGE'):
558 logger.info('Setting DEPLOY_DIR_IMAGE to folder containing %s (%s)' % (self.qemuboot, imgdir))
559 self.set('DEPLOY_DIR_IMAGE', imgdir)
560
548 def print_config(self): 561 def print_config(self):
549 logger.info('Continuing with the following parameters:\n') 562 logger.info('Continuing with the following parameters:\n')
550 if not self.fstype in self.vmtypes: 563 if not self.fstype in self.vmtypes: