Bug 10447 - eSDK: runqemu fails unless unless DEPLOY_DIR_IMAGE is set
Summary: eSDK: runqemu fails unless unless DEPLOY_DIR_IMAGE is set
Status: RESOLVED FIXED
Alias: None
Product: eSDK
Classification: Yocto Project Subprojects
Component: eSDK (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.3 M4
Assignee: Paul Eggleton
QA Contact: Francisco Pedraza
URL:
Whiteboard:
: 10465 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-17 22:59 UTC by Henry Bruce
Modified: 2017-04-19 10:08 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Bruce 2016-10-17 22:59:51 UTC
Expected Behavior
-----------------
Install qemux86 eSDK
Build and run qemu image

Observed Behavior
-----------------
Install qemux86 eSDK
Build qemu image
qemu session fails to start

$ runqemu
runqemu - INFO - Assuming MACHINE = qemux86
runqemu - INFO - Can't find qemuboot conf file, DEPLOY_DIR_IMAGE is NULL!
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - Overriding conf file setting of STAGING_DIR_NATIVE to /home/hbruce/Tools/yocto/qemux86-ext-2.2/tmp/sysroots/x86_64-linux from Bitbake environment
runqemu - INFO - Overriding conf file setting of STAGING_BINDIR_NATIVE to /home/hbruce/Tools/yocto/qemux86-ext-2.2/tmp/sysroots/x86_64-linux/usr/bin from Bitbake environment
Traceback (most recent call last):
  File "/home/hbruce/Tools/yocto/qemux86-ext-2.2/layers/poky/scripts/runqemu", line 1019, in <module>
    ret = main()
  File "/home/hbruce/Tools/yocto/qemux86-ext-2.2/layers/poky/scripts/runqemu", line 1007, in main
    config.check_and_set()
  File "/home/hbruce/Tools/yocto/qemux86-ext-2.2/layers/poky/scripts/runqemu", line 559, in check_and_set
    self.check_fstype()
  File "/home/hbruce/Tools/yocto/qemux86-ext-2.2/layers/poky/scripts/runqemu", line 451, in check_fstype
    raise Exception("FSTYPE is NULL!")
Exception: FSTYPE is NULL!
[hbruce@hbruce-desk3 qemux86-ext-2.2]$ . environment-setup-i586-poky-linux 

Workaround
----------
Manually set DEPLOY_DIR_IMAGE
DEPLOY_DIR_IMAGE=/path/to/esdk/tmp/deploy/images/qemux86 runqemu qemux86

Steps to reproduce
------------------
1. Build core-image-minimal image with MACHINE=qemux86
2. Build minimal extensible SDK installer
3. Install eSDK
4. Start eSDK session by running 'source environment-setup-i586-poky-linux'
4. Build image with 'devtool build-image'
5. Start qemu session with 'runqemu qemux86'

An example eSDK installer can be found at http://downloads.yoctoproject.org/tools/support/workflow/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.sh
Comment 1 Paul Eggleton 2016-10-18 02:54:38 UTC
Fix sent. The new runqemu script is making an assumption it should not - and not handling the error particularly well - but I think at this stage that's something we will have to fix later. For now the patch I've sent resolves the issue within the eSDK (although if you were to run runqemu directly, as you now can in master/morty by virtue of the fix to allow the Eclipse plugin to work, then it'll still be a problem).
Comment 2 Paul Eggleton 2016-10-20 01:55:43 UTC
*** Bug 10465 has been marked as a duplicate of this bug. ***
Comment 4 Francisco Pedraza 2016-10-27 21:45:08 UTC
Tested on morty and Failed
I followed this Steps to reproduce
------------------
1. Build core-image-minimal image with MACHINE=qemux86
2. Build minimal extensible SDK installer
3. Install eSDK
4. Start eSDK session by running 'source environment-setup-i586-poky-linux'
4. Build image with 'devtool build-image'
5. Start qemu session with 'runqemu qemux86'

and I got the same error message:
raise Exception("FSTYPE is NULL!")
Exception: FSTYPE is NULL!
Regards,
Comment 5 Francisco Pedraza 2016-10-27 21:55:27 UTC
Failed on morty.
Comment 6 Paul Eggleton 2016-10-27 22:19:00 UTC
Which morty revision did you test?
Comment 7 Jose Perez C 2016-10-28 12:20:24 UTC
I'm seeing same failure on master commit: e5815d0b607ff262663864d51fe51fbb37172329
Comment 8 Paul Eggleton 2016-11-01 22:50:24 UTC
Sigh. So it turns out I didn't quite read the bug properly - this is talking about running runqemu directly, which until recently wasn't even possible (we had to allow it in order for the Eclipse plugin to work - but I believe it runs it with arguments such that this problem doesn't occur). However if you read my comment above I did say that running runqemu directly would still cause this issue to happen. If you want to run qemu in the eSDK from the command line, the recommended way to do it is "devtool runqemu" which is what I fixed. So there is a way to do it that works. Alternatively you should be able to run it directly if you give it the full path to the image.

Where does this leave us with this bug though? Running runqemu this way *should* work. The problem is the newly rewritten script is assuming it cannot run bitbake to get DEPLOY_DIR_IMAGE when that's not actually true in the eSDK. To compound things, it quite clearly does run bitbake later on so there is a disconnect in the logic.
Comment 9 Paul Eggleton 2016-11-01 22:55:25 UTC
BTW, I also entered bug 10471. Depending on how that is resolved it may end up fixing this.
Comment 10 Henry Bruce 2016-11-02 03:10:40 UTC
When I first reported the bug, I saw the same behavior in 'runqemu' and 'devtool runquemu'. I reported the 'runqemu' variation as I assumed that was closer to the root cause.

I'm OK with only having 'devtool runquemu' work, but if we take that option 'runqemu' should fail with a "don't run me directly" error.
Comment 11 Paul Eggleton 2016-11-02 03:20:17 UTC
I do agree, running runqemu directly should be made to work especially as it's now easily accessible. I just wanted to make sure people have a full understanding of what's going on and that there's a workaround.
Comment 12 Paul Eggleton 2017-04-19 08:58:12 UTC
I've send a patch working around this.