Saturday, June 11, 2011

Root filesystem for Beagleboard on MMC card

Update: There is of course the rootwait kernel parameter, which is better. (I'll leave the rest in case someone else searches for the same symtoms.)


Just in case someone else has the same problem, I've had a frustrating few days trying to get my own kernel to start up with the root filesystem on /dev/mmcblk0p2.

I based my kernel on the config found here, and based my boot.scr file on the one supplied with the Debian Net Install generates with "mk_mmc.sh --uboot beagle_bx".

No matter which kernel I tried, or boot.scr options I could find, I kept getting a kernel panic whenever I tried to use root=/dev/mmcblk0p2 (rather than an initfd):

[    4.075317] regulator_init_complete: VDAC: incomplete constraints, leaving on
[    4.083404] md: Waiting for all devices to be available before autodetect
[    4.090637] md: If you don't use raid, use raid=noautodetect
[    4.097534] md: Autodetecting RAID arrays.
[    4.101928] md: Scanned 0 and added 0 devices.
[    4.106628] md: autorun ...
[    4.109558] md: ... autorun DONE.
[    4.113159] Root-NFS: no NFS server address
[    4.117614] VFS: Unable to mount root fs via NFS, trying floppy.
[    4.124816] VFS: Cannot open root device "mmcblk0p2" or unknown-block(2,0)
[    4.132141] Please append a correct "root=" boot option; here are the available partitions:
[    4.140991] 1f00             512 mtdblock0  (driver?)
[    4.146362] 1f01            1920 mtdblock1  (driver?)
[    4.151672] 1f02             128 mtdblock2  (driver?)
[    4.157012] 1f03            4096 mtdblock3  (driver?)
[    4.162384] 1f04          255488 mtdblock4  (driver?)
[    4.167724] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[    4.176483] [] (unwind_backtrace+0x0/0xf8) from [] (panic+0x5c/0x190)
[    4.185150] [] (panic+0x5c/0x190) from [] (mount_block_root+0x160/0x214)
[    4.194061] [] (mount_block_root+0x160/0x214) from [] (mount_root+0xa8/0xc4)
[    4.203338] [] (mount_root+0xa8/0xc4) from [] (prepare_namespace+0x15c/0x1c0)
[    4.212707] [] (prepare_namespace+0x15c/0x1c0) from [] (kernel_init+0x150/0x194)
[    4.222381] [] (kernel_init+0x150/0x194) from [] (kernel_thread_exit+0x0/0x8)

The solution turns out to be dead simple (but I couldn't find a reference to it on the web): the rootdelay kernel parameter gives the kernel time to detect the MMC card before trying to mount it.

Now, if I can just work out how to stop Debian's "Detecting Network Hardware" stopping the installation process in its tracks, I'll be a happy man...

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home