我有一个SPI闪存存储设备,我想在该闪存设备上使用UBIFS文件系统作为我的rootfs。我面临的问题是UBI模块在SPI模块初始化之前初始化。因此,当UBI加载时,它不能附加到我告诉它的UBI设备上(通过内核命令行),所以没有rootfs。以下控制台输出说明了这一点。
我一直深入到源代码中,看到init/main.c有一个do_initcalls()函数,它只是调用一个函数指针列表。这些函数指针指向内核内置模块的所有module_init()函数。这些函数指针被放置在内核二进制文件的一个特殊部分,所以这个顺序是在编译时选择的。但是,我还没有弄清楚这个订单是如何确定的。
[ 0.482500] UBI error: ubi_init: UBI error: cannot initialize UBI, error -19
[ 0.492500] atmel_spi atmel_spi.0: Using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[ 0.500000] atmel_spi atmel_spi.0: Atmel SPI Controller at 0xf0000000 (irq 13)
[ 0.507500] m25p80 spi0.1: mx25l25635e (32768 Kbytes)
[ 0.512500] Creating 7 MTD partitions on "jedec_flash":
[ 0.520000] 0x000000000000-0x000000020000 : "loader"
[ 0.527500] 0x000000020000-0x000000060000 : "u-boot"
[ 0.537500] 0x000000060000-0x000000080000 : "u-boot-env"
[ 0.547500] 0x000000080000-0x000000280000 : "kernel0"
[ 0.557500] 0x000000280000-0x000000480000 : "kernel1"
[ 0.567500] 0x000000480000-0x000001240000 : "fs"
[ 0.575000] 0x000001240000-0x000002000000 : "play"
[ 0.590000] AT91SAM9 Watchdog enabled (heartbeat=15 sec, nowayout=0)
[ 0.607500] TCP cubic registered
[ 0.615000] VFS: Cannot open root device "ubi0:root0" or unknown-block(0,0)
[ 0.622500] Please append a correct "root=" boot option; here are the available partitions:
[ 0.630000] 1f00 128 mtdblock0 (driver?)
[ 0.635000] 1f01 256 mtdblock1 (driver?)
[ 0.640000] 1f02 128 mtdblock2 (driver?)
[ 0.645000] 1f03 2048 mtdblock3 (driver?)
[ 0.650000] 1f04 2048 mtdblock4 (driver?)
[ 0.655000] 1f05 14080 mtdblock5 (driver?)
[ 0.660000] 1f06 14080 mtdblock6 (driver?)
[ 0.665000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)