Bug 693

Summary: Live image booting pauses indefinitely with 'waiting for removable media' message
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Tom Zanussi <tom.zanussi>
Component: meta-yoctoAssignee: Tom Zanussi <tom.zanussi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, sgw
Version: 0.9   
Target Milestone: 0.9.1   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Tom Zanussi 2011-02-01 12:59:08 UTC
On my x86 crownbay system, I get this message most of the time now booting a live image from USB, but it's still very dependent on media/USB slot e.g. plugging into slot3 will always elicit it, while taking the same stick and plugging into slot 0 never elicits it.  Or one type of USB stick always elicits it, while the same image burned onto another USB stick doesn't elicit it (most of the time).

In all cases, however, removing and then reinserting the USB stick allows the boot to continue successfully.

Though it started showing up on the crownbay recently, I have seen the problem on other machines, though more rarely.

The problem happens because the loop in init-live.sh never sees /media/sdb appear, and /media/sdb doesn't appear because udevd never sees the message from the kernel telling it sdb is there - in these cases it seems to be that sdb is first detected by the kernel, and udevd comes up following that - apparently in the situations where the problem doesn't occur, udevd comes up first, then the drive is detected and things function normally by accident.

It shouldn't actually matter which order the above happens - the kernel is supposed to queue the events and send them when the daemon is ready, but that doesn't seem to be happening in this case.  I thought the problem might be that init-live.sh starts udevd (in early_setup()), but never calls 'udevadm trigger' or 'udevadm settle' after that, which presumably should replay the missed events in the case where init-live.sh happens after sdb is detected, but adding those commands to early_setup() didn't fix the problem.
Comment 1 Tom Zanussi 2011-02-07 13:27:37 UTC
As it turns out, 'udevadm trigger' is what's needed after all - the problem was that all the documentation I looked at said that 'add' was the default, while in reality 'change' has been the default since version 152, which is why the mount.sh rule never got invoked, since it's tied to 'add' and 'add' events don't get sent without any explicit '--action=add'.