Fail to mount a ext2 partition /dev/mmcblk0p1 on SD card as root filesystem in kernel 3.2

From: Sonic Zhang
Date: Fri Mar 02 2012 - 05:53:22 EST


Hi,

Kernel 3.2 panic when I mount a ext2 partition /dev/mmcblk0p1 on SD
card as root file system.

My boot parameter line is "root=/dev/mmcblk0p1 rw rootwait
earlyprintk=serial,uart0,57600 console=ttyBF0,57600".

After reading init/do_mounts.c a bit, I find VFS folders "/dev" and
"/root" don't exist when mount_root() tries to create block device
node "/dev/root" and mount this device at path "/root". If I create
these folders by mkdir() before line create_dev() in function
mount_root(), kernel boots up on SD card properly.

Where should folders "/dev" and "/root" be created? Any hint?

Thanks

void __init mount_root(void)
{
.......
#ifdef CONFIG_BLOCK
create_dev("/dev/root", ROOT_DEV);
mount_block_root("/dev/root", root_mountflags);
#endif
}

static int __init do_mount_root(char *name, char *fs, int flags, void *data)
{
int err = sys_mount(name, "/root", fs, flags, data);
if (err)
return err;
......
}

Sonic Zhang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/