Bug 2890

Summary: runqemu: starting an image of a BSP created with yocto-bsp tool fails
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Laurentiu Serban <laurentiu.serban>
Component: coreAssignee: Mihai Prica <mihai.prica>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandrux.palalau, dvhart, jessica.zhang, meta.mr.watcher, meta.watcher, sgw, tom.zanussi
Version: 1.3   
Target Milestone: 1.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on: 5262    
Bug Blocks:    
Attachments:
Description Flags
myqemuarm none

Description Laurentiu Serban 2012-08-03 23:27:28 UTC
Created attachment 674 [details]
myqemuarm

A BSP image was created using the yocto-bsp tool.
See the attachement.
a core-image-minimal image was created but it cannot be started.

lserban@laurentiu-02:~/work/master/build$ runqemu tmp/deploy/images/zImage-myqemuarm.bin tmp/deploy/images/core-image-minimal-myqemuarm.ext3
Set MACHINE to [zImage-myqemuarm.bin] based on kernel [tmp/deploy/images/zImage-myqemuarm.bin]

Continuing with the following parameters:
KERNEL: [tmp/deploy/images/zImage-myqemuarm.bin]
ROOTFS: [tmp/deploy/images/core-image-minimal-myqemuarm.ext3]
FSTYPE: [ext3]
Setting up tap interface under sudo
[sudo] password for lserban:
Acquiring lockfile for tap0...
Error: Unsupported machine type zImage-myqemuarm.bin

commit id 62d42fe3cfa575cb97b484ccf7b2e9a25cc50770
Comment 1 Darren Hart 2012-08-03 23:32:48 UTC
This appears to be a feature request for runqemu actually. Assinging to Scott G to have a look.
Comment 2 Scott Garman 2012-08-19 17:04:52 UTC
Fixed in oe-core and poky master as of:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=641f582f53f71ec8e7ed28369b6d253e360f2d69
Comment 3 Alexandru Palalau 2012-09-24 14:39:15 UTC
Verified on master branch.
Latest commit id: df74f8d9a8b1500da3fffd77f12ec8d1900d0bf6
Comment 4 Tom Zanussi 2012-12-10 21:23:03 UTC
I created a bsp called meta-qemutest, with a machine name of 'qemutest'.   Running runqemu with the following command-line

[trz@empanada build]$ runqemu tmp/deploy/images/bzImage-qemutest.bin tmp/deploy/images/core-image-sato-qemutest.ext3

Fails with a bitbake -e dump:

Set MACHINE to [bzImage-qemutest.bin] based on kernel [tmp/deploy/images/bzImage-qemutest.bin]

Continuing with the following parameters:
KERNEL: [tmp/deploy/images/bzImage-qemutest.bin]
ROOTFS: [tmp/deploy/images/core-image-sato-qemutest.ext3]
FSTYPE: [ext3]
There was an error running bitbake to determine TMPDIR
Here is the output from 'bitbake -e':
# do_package_write_deb=None
# ROOT_FLASH_SIZE=280
ROOT_FLASH_SIZE="280"
# STAGING_BINDIR_CROSS=${STAGING_BINDIR}/crossscripts
STAGING_BINDIR_CROSS="/home/trz/yocto/yocto-bsp-dev/build/tmp/sysroots/mycustomqemux86/usr/bin/crossscripts"


As seen in the output, runqemu thinks the machine name is 'bzImage-qemutest.bin'.

When I give it the name of the machine so it doesn't have to guess, I get past the initial problem but only end up with another one (Unsupported machine):

[trz@empanada build]$ MACHINE=qemutest runqemu tmp/deploy/images/bzImage-qemutest.bin tmp/deploy/images/core-image-sato-qemutest.ext3 

Continuing with the following parameters:
KERNEL: [tmp/deploy/images/bzImage-qemutest.bin]
ROOTFS: [tmp/deploy/images/core-image-sato-qemutest.ext3]
FSTYPE: [ext3]
Setting up tap interface under sudo
[sudo] password for trz: 
Acquiring lockfile for tap0...
Error: Unsupported machine type qemutest
Comment 5 Tom Zanussi 2013-04-29 23:05:35 UTC
I think this is still a runqemu problem, as mentioned in comment 1.
Comment 6 Tom Zanussi 2013-05-03 21:51:00 UTC
Assigning to default assignee - this is a runqemu bug.
Comment 7 Mihai Prica 2013-09-02 12:53:11 UTC
From the bug description I see that there are 2 problems:
1) MACHINE is not correctly detected from a kernel filename. 
The runqemu script only detects known MACHINE values (qemuarm, qemux86...) from kernel filenames. An error should be generated saying that the detection failed. A patch was sent to fix this.

2) Even when MACHINE=qemutest the runqemu script causes an error.
This is the expected behavior because the runqemu script chooses an appropriate qemu binary to run based on the MACHINE name. Since qemutest is not a known MACHINE name there is no way to know which qemu binary should be used.
Comment 8 Mihai Prica 2013-09-05 07:15:18 UTC
Fixed by commit: 12d003a80031304775b031002c75c64c53f7a7f9
Link: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=12d003a80031304775b031002c75c64c53f7a7f9
Comment 9 Alexandru Palalau 2013-09-27 07:57:28 UTC
Verified on master branch.
Commit ID: b049d532f6e0ab9e458e486f81b00be47ee69acf