请教如何把rootfs从挂载在flash上改成挂载到ram上

2025-03-22 03:19:47
推荐回答(1个)
回答(1):

目前用的是Qualcomm的MSM9x15平台,目前代码中使用的bootcmd为:

KERNEL_BOOT_OPTIONS ?= "root=/dev/mtdblock2 rw rootfstype=yaffs2 rootflags=tags-ecc-off console=ttyHSL0,115200 console=ttyHSL1,115200"


root是挂载在flash上的。

现在的需求要改成挂载到ram上,按照baidu的方法,我试着改了一下:

KERNEL_BOOT_OPTIONS ?= "root=/dev/ram0 rw console=ttyHSL0,115200 console=ttyHSL1,115200"

但是内核启动的时候报错说找不到rootfs,如下面的错误。


对这一块很陌生,请教如何改到挂载到ram上呢?

万谢!

List of all partitions:

1f00            1024 mtdblock0  (driver?)

1f01           20736 mtdblock1  (driver?)

1f02           50688 mtdblock2  (driver?)

1f03           40704 mtdblock3  (driver?)

1f04          152576 mtdblock4  (driver?)

1f05            5376 mtdblock5  (driver?)

1f06            2304 mtdblock6  (driver?)

No filesystem could mount root, tried:  ext3 ext2 ext4 squashfs vfat btrfs yaffs yaffs2

VFS: Unable to mount root fs on unknown-block(1,0)

User configuration error - no valid root filesystem found

Kernel panic - not syncing: Invalid configuration from end user prevents continuing

[] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24)

[] (dump_stack+0x20/0x24) from [] (panic+0x94/0x1cc)

[] (panic+0x94/0x1cc) from [] (mount_block_root+0x1ec/0x238)

[] (mount_block_root+0x1ec/0x238) from [] (mount_root+0xf8/0x11c)

[] (mount_root+0xf8/0x11c) from [] (prepare_namespace+0x168/0x1c8)

[] (prepare_namespace+0x168/0x1c8) from [] (kernel_init+0x1ec/0x230)

[] (kernel_init+0x1ec/0x230) from [] (kernel_thread_exit+0x0/0x8)

Watchdog bite received from modem software!

modem subsystem failure reason: err.c:537:Error detected on remote processor..

subsys-restart: subsystem_restart(): Restart sequence requested for modem, restart_level = 1.

Kernel panic - not syncing: subsys-restart: Resetting the SoC - modem crashed.

[] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24)

[] (dump_stack+0x20/0x24) from [] (panic+0x94/0x1cc)

[] (panic+0x94/0x1cc) from [] (subsystem_restart+0x1e8/0x234)

[] (subsystem_restart+0x1e8/0x234) from [] (restart_modem+0xb4/0xd0)

[] (restart_modem+0xb4/0xd0) from [] (modem_wdog_bite_irq+0x38/0x60)

[] (modem_wdog_bite_irq+0x38/0x60) from [] (handle_irq_event_percpu+0x98/0x2a4)

[] (handle_irq_event_percpu+0x98/0x2a4) from [] (handle_irq_event+0x64/0x84)

[] (handle_irq_event+0x64/0x84) from [] (handle_fasteoi_irq+0xbc/0x120)

[] (handle_fasteoi_irq+0xbc/0x120) from [] (generic_handle_irq+0x30/0x40)

[] (generic_handle_irq+0x30/0x40) from [] (handle_IRQ+0x70/0x94)

[] (handle_IRQ+0x70/0x94) from [] (gic_handle_irq+0x48/0x60)

[] (gic_handle_irq+0x48/0x60) from [] (__irq_svc+0x40/0x70)

Exception stack(0xcf02de48 to 0xcf02de90)

de40:                   0001f03a ffffffff 000006fc c0055848 00000000 0000012c

de60: 00000190 0000000a c0a31068 ceab515d c0925c68 cf02debc cf02de90 cf02de90

de80: c06671e8 c03521b0 20000013 ffffffff

[] (__irq_svc+0x40/0x70) from [] (__delay+0x0/0xc)

复制代码