diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2017-03-16 03:13:26 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-17 16:53:04 +0000 |
commit | 766dccf9754437440ab5d6eb993248035ff1339b (patch) | |
tree | 9cd90cd99a5266f6c21df8a3df1411f6aa722ce8 | |
parent | 8e9769773fd6d04402581c005bb423530a726457 (diff) | |
download | poky-766dccf9754437440ab5d6eb993248035ff1339b.tar.gz |
runqemu: only boot ramfs when specified
This can fix a problem:
IMAGE_FSTYPES += "iso"
$ bitbake core-image-minimal
$ runqemu qemux86
It may boot core-image-minimal-initramfs rather than core-image-minimal, this
is not what we want usually. This patch makes it avoid booting ramfs when there
are other choices, or when it is specified, for example, "runqemu qemux86 ramfs"
(From OE-Core rev: 614bde6774f4dfd414066bbaf75ed422943e37ab)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/runqemu | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 17219563a8..4fa2867e73 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -660,7 +660,15 @@ class BaseConfig(object): | |||
660 | logger.info('Running %s...' % cmd) | 660 | logger.info('Running %s...' % cmd) |
661 | qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') | 661 | qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') |
662 | if qbs: | 662 | if qbs: |
663 | self.qemuboot = qbs.split()[0] | 663 | for qb in qbs.split(): |
664 | # Don't use initramfs when other choices unless fstype is ramfs | ||
665 | if '-initramfs-' in os.path.basename(qb) and self.fstype != 'cpio.gz': | ||
666 | continue | ||
667 | self.qemuboot = qb | ||
668 | break | ||
669 | if not self.qemuboot: | ||
670 | # Use the first one when no choice | ||
671 | self.qemuboot = qbs.split()[0] | ||
664 | self.qbconfload = True | 672 | self.qbconfload = True |
665 | 673 | ||
666 | if not self.qemuboot: | 674 | if not self.qemuboot: |