Bug 6353 - poky-tiny will not boot in qemux86
Summary: poky-tiny will not boot in qemux86
Status: VERIFIED FIXED
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 1.6
Hardware: x86 x86
: High normal
Target Milestone: 1.6.2
Assignee: Tom Zanussi
QA Contact: Lucian Musat
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-05-20 16:40 UTC by Matt Schuckmann
Modified: 2014-09-12 07:50 UTC (History)
8 users (show)

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


Attachments
linux-yocto-tiny kernel config (72.95 KB, application/octet-stream)
2014-05-23 17:54 UTC, Saul Wold
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Schuckmann 2014-05-20 16:40:34 UTC
I built a poky-tiny image following instructions at 
https://wiki.yoctoproject.org/wiki/Poky-Tiny using yocto 1.6. 
All attempts to boot the image following the instructions given produce no output. 

I also attempted to run the image with the command 
runqemu qemux86 ramfs 
with the the same result. 

I did try the same thing with yocto 1.5 and it at least attempts to boot but gets stuck running init because setsid is not included in busybox. 

[    3.379021] Freeing unused kernel memory: 284k freed
/init: line 26: setsid: not found
Console sh exited with 127, respawning...
/init: line 26: setsid: not found
Console sh exited with 127, respawning...

A patch to fix this was submitted back in 2013 but it doesn't look like it was ever accepted, some alternatives were suggested but I don't think they were acted on. 
https://lists.yoctoproject.org/pipermail/poky/2013-November/009379.html
Comment 1 Darren Hart 2014-05-22 23:55:33 UTC
Can you please attach the resulting .config from your linux-yocto build directory?

tmp/work/MACHINE/linux-yocto*/*/linux*build/.config

You'd want to check for things like serial console, 8250 support, etc. I'd try adding kernel arguments like "debug" and "earlyprintk=..." and "initcalldebug" and see if that helps get anything out before it hangs.
Comment 2 Saul Wold 2014-05-23 17:54:54 UTC
Darren, just to be clear, I am working on fixing the core issue, but can't get 
tiny to boot at all, slight different issue than what Matt reported.  Using the 
following command line yeilds nothing, I have to kill the qemu process.

qemu-system-i386 -kernel tmp/deploy/images/qemux86/bzImage-qemux86.bin -initrd 
tmp/deploy/images/qemux86/core-image-minimal-qemux86.cpio.gz -nographic -append 
"console=ttyS0 root=dev/ram0 debug"
Comment 3 Saul Wold 2014-05-23 17:54:57 UTC
Created attachment 1977 [details]
linux-yocto-tiny kernel config
Comment 4 Darren Hart 2014-05-23 18:02:29 UTC
So I immediately notice there is not 8250 nor any serial console, nor any VGA console support in that .config, so I wouldn't expect any output at all. At some point, the tiny kernel config has broken.

Next step is to examine the kernel config logs (linux-yocto/<version>/linux/.meta/...) (we need a symlink to here from the logs directory or something)
Comment 5 Matt Schuckmann 2014-05-23 18:15:38 UTC
Thanks Saul, my .config file matches yours. 

Darren, I new to yocto and openembedded so I'm not sure what you mean by needing a link to the logs. Is there something you would like me to do, or were you just thinking out loud?
Comment 6 Saul Wold 2014-05-23 18:20:25 UTC
Ok, so I posted the patch for busybox.

Matt, you seem to have gotten further then me then with it booting into the 
init, I am not even booting right now!
Comment 7 Matt Schuckmann 2014-05-23 18:32:05 UTC
Saul, no I don't think I got any further than you. 
With Yocot 1.6 I can't boot at all, which I think is the same as you.

With Yocto 1.5 it boots to init but then gets stuck as I described, that problem appears to be that busybox isn't configured correctly as pointed out in the link I provided, but there was some argument as to the correct way to get it configured. I don't understand the various options so I can't comment on what to do there.
Comment 8 Darren Hart 2014-05-23 18:33:01 UTC
Mark, yeah - just thinking out loud - context for Saul, Tom, and I as we work to improve usability here. :-)
Comment 9 Tom Zanussi 2014-05-27 13:40:55 UTC
I don't see any output at all with 1.5 either.

So we need a starting point that does work in order to determine what doesn't work.
Comment 10 Stoicescu Cornel 2014-05-28 12:03:00 UTC
Hello,

I am working with 1.6_M1 tag. I used the following command to get to the init nosuid issue:

tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 -kernel tmp/deploy/images/qemux86/bzImage-qemux86.bin -initrd tmp/deploy/images/qemux86/core-image-minimal-qemux86-20140528193249.rootfs.cpio.gz -nographic -append "console=ttyS0 root=/dev/ram0"

I took the steps from here:
https://wiki.yoctoproject.org/wiki/Poky-Tiny
Comment 11 Stoicescu Cornel 2014-05-28 12:04:53 UTC
I mean setsid issue:

Console sh exited with 127, respawning...
/init: line 26: setsid: not found
Comment 12 Saul Wold 2014-06-02 23:27:18 UTC
Just to add some additional information, if you remove the "_poky" from the 
meta-yocto/recipes/core/busybox*.bbappend file and rebuild your image (you may 
need to cleansstate busybox) that will correct the setsid issue.

I was able to reproduce the non-booting kernel issue with 1.6, if I just swap 
out the kernel from 1.6 -> 1.5, it boots into the user space just fine 
(assuming you have the above fix). 

I will open another bug against the non-booting kernel since it's different 
thank the orignal issue here, which has a fix posted in poky@yoctoproject.org.
Comment 13 Saul Wold 2014-06-02 23:56:26 UTC
Check poky-tiny.conf, it seems that it is still using 3.8% for the kernel 
version, I tested with 3.14 and it seems to boot, this might be the problem, 
but I discovered a different issue with busybox in 1.6 and master.
Comment 15 Lucian Musat 2014-06-10 07:48:31 UTC
Hello Saul,

Tried poky-tiny with your commit but still does not work. It freezes the terminal.
Comment 16 Lucian Musat 2014-07-16 11:41:17 UTC
Still not working on latest master (1dcdd877c7946be4c0b1203deb14e2f842f9d0c2). Any news on this?
Comment 17 Bogdan Alexandru Voiculescu 2014-08-04 08:00:20 UTC
 Lucian Musat 2014-07-16 11:41:17 UTC

Still not working on latest master (1dcdd877c7946be4c0b1203deb14e2f842f9d0c2). Any news on this?
Comment 18 Stephen K Jolley 2014-08-07 15:06:01 UTC
Does this happen with 1.7 M2 as well?
Comment 19 Lucian Musat 2014-08-11 10:18:53 UTC
Yes, this reproduces on 1.7.M2 (2d1660112e54653f7bb763939d0416472c49fe01)
Comment 20 Saul Wold 2014-08-14 03:17:37 UTC
Can you please re-verify this in 1.5.3.  I do think we have a kernel config issue since it was mentioned no console or vga support, so at a minimum we need an updated configuation that support output.
Comment 21 Lucian Musat 2014-08-19 10:43:29 UTC
Re-verified on 1.5.3 and setsid issue happens:

Console sh exited with 127, respawning...
/init: line 26: setsid: not found
Comment 22 Tom Zanussi 2014-08-19 12:30:10 UTC
(In reply to comment #21)
> Re-verified on 1.5.3 and setsid issue happens:
> 
> Console sh exited with 127, respawning...
> /init: line 26: setsid: not found

OK, this was supposed to have been fixed by Saul's patch:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e7114046be6e71fb326477dc882adb814ef6a751

but it seems that isn't actually the case according to this result.  Which is also not a kernel bug, but a busybox bug.

So noting that there are apparently two bugs here, the setsid bug and the kernel bug?
Comment 23 Saul Wold 2014-08-19 14:05:39 UTC
I have confirmed that I can booth a 3.8 Kernel taken from Dora with a rootfs 
build from Daisy.  If I try to build the Daisy based 3.10 kernel it fails to 
boot correctly, in this case it hangs in qemu with no output on the screen at 
all.

I run qemu as follows:
 tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 -kernel 
tmp/deploy/images/qemux86/bzImage-qemux86.bin -initrd 
tmp/deploy/images/qemux86/core-image-minimal-qemux86.cpio.gz -nographic -append 
"console=ttyS0 root=/dev/ram0"

I can swap the -kernel option between a 3.8 and 3.10 kernel an observe the 
breakage.

Sau!
Comment 24 Tom Zanussi 2014-08-26 22:33:39 UTC
So the problem is that the 8250.cfg kernel options aren't getting enabled, and therefore nothing shows up on the console and it looks like a hung machine.

And the reason the 8250 options aren't getting enabled is that CONFIG_TTY isn't getting enabled.

CONFIG_TTY isn't explicitly mentioned in any config fragment, but it defaults to 'y', so you'd expect it to be turned on if not mentioned (and it's not an 'is not set' item either.).

On the other hand, if unset options are forced 'not set', that would explain why it doesn't get set.

On the other hand again, a normal non-tiny core-image-minimal doesn't specify CONFIG_TTY either way, and it does get set to 'y'.

Adding CONFIG_TTY=y to the common-pc-drivers.cfg fixes things, but I'm wondering why this didn't show up as a problem before.

Adding Bruce to the cc: - he may possibly see an obvious explanation.
Comment 25 Darren Hart 2014-08-26 22:38:39 UTC
iirc, tiny should be starting off with an allnoconfig as opposed to using defaults. I don't recall where that's specified though...
Comment 26 Darren Hart 2014-08-26 22:41:17 UTC
perhaps CONFIG_TTY belongs where CONFIG_SERIAL_8250_CONSOLE is specified, like in 8250.cfg?

There are many others specifying that which should probably just include 8250.cfg instead.
Comment 27 Tom Zanussi 2014-08-26 22:46:16 UTC
Yeah, my patches for this add CONFIG_TTY to both cfg/8250.cfg and common-pc-drivers.cfg (which I also wondered why it wouldn't just be including 8250.cfg itself), but I don't want to just fix the symptom - i.e. need to remember how TTY gets turned on in non-tiny but off in tiny (hoping it's not just a 'select' side-effect of the larger config, though I don't directly see any 'select TTY' anywhere so it's not direct)...
Comment 28 Darren Hart 2014-08-26 22:55:24 UTC
If it is default Y, it should be on in the standard ktypes, but off in the tiny ktypes unless explicitly requested. That is one of the ways by which tiny is kept small - you only get what you explicitly ask for. Makes it a lot more susceptible to incomplete meta-data like this.
Comment 29 Tom Zanussi 2014-08-26 23:14:54 UTC
Yes, that makes sense, but I'm looking for the mechanism by which that happens, slipping by me at the moment..
Comment 30 Darren Hart 2014-08-26 23:20:04 UTC
See linux-yocto-3.14/meta/tiny/tiny.scc:

include ktypes/standard/standard.scc nocfg inherit

Should be the nocfg part iirc
Comment 31 Bruce Ashfield 2014-08-27 04:22:27 UTC
There's two things at play:

  - the "nocfg" inherit that Darren points out
  - CONFIG_MODE = "--allnoconfig" in the -tiny recipe

The CONFIG_MODE = "--allnoconfig" is doing what Darren mentioned
before, it starts the configuration by changing the default of
every option to =n, and we then start applying the fragments.

So we do need to be explicit and enable all the options to get
a feature fragment functional .. which is always a good policy
regardless :)
Comment 32 Tom Zanussi 2014-08-27 14:39:46 UTC
Patches submitted to linux-yocto
Comment 34 Lucian Musat 2014-09-10 11:14:45 UTC
Verified in latest master (1894522f357fdf0b6adb2dcc14f12817628596bd) and it's still not working
Comment 35 Tom Zanussi 2014-09-10 15:21:16 UTC
(In reply to comment #34)
> Verified in latest master (1894522f357fdf0b6adb2dcc14f12817628596bd) and
> it's still not working

Yeah, it's because the SRCREV's haven't been updated.  The meta branch is at:

ccad961c4cb6be245ed198bd2c17c27ab33cfcd7

which is before the tty config fragments.
Comment 36 Tom Zanussi 2014-09-10 16:05:11 UTC
Looks like you need to update your poky/master to at least:

commit 56e93f5292932e49ee10f90ada14011b6a328791
Author: Bruce Ashfield <bruce.ashfield@windriver.com>
Date:   Mon Sep 8 15:33:33 2014 -0400

    linux-yocto/3.14: configuration updates and feature merges.
    
    Updating the 3.14 meta and machine SRCREVs to pick up the following changes:
    
    meta/config:
    
        a94680bfeb0e drm-gma500: build GMA500 DRM driver as kernel module
        21783e2e6be2 intel-common: intel-core-32: use tunnelcreek.scc
        0b46240ac3b3 soc: tunnelcreek: create tunnelcreek scc
        c7207d9c0e6a qemuppc64: create bsp config
        8f553f77e0ad meta: Create kernel config and scc for CRIU
        dacb1c1ab011 meta: common-pc: add support for booting via EFI
        b85e4cb574d6 meta: Add CONFIG_TTY to common-pc-drivers.cfg
        33f2c8d2ba33 meta: Add CONFIG_TTY to 8250.cfg
        e6f31e4894d5 GRE: enable gre feature.
Comment 37 Tom Zanussi 2014-09-10 16:10:09 UTC
change from notabug
Comment 38 Saul Wold 2014-09-10 16:10:38 UTC
It really is fixed, the change finally made master in the commit mentioned 
above: 

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=56e93f5292932e49ee10f90ada14011b6a328791
Comment 39 Lucian Musat 2014-09-12 07:50:27 UTC
Verified this on commit bd1a3ab8a63d6b2c109d595c67fcca99817e1daa