由于我要加快系统的启动速度,所以想省去 initramfs ,在 x86 上是可以让内核直接挂载根文件系统的,但在 arm 架构下这么做会报这样一个错误:
[ 3.212932] VFS: Cannot open root device "sda3" or unknown-block(0,0): error -6
[ 3.220360] Please append a correct "root=" boot option; here are the available partitions:
我看了一下内核代码 init/do_mounts.c 的 mount_root 函数,我发现在 x86 上这个函数用到的 ROOT_DEV 是在 arch/x86/kernel/setup.c 这里被赋值的,而 arm 上这个值是 0 ,arm 体系结构相关的代码没有赋值 ROOT_DEV ,所以我怀疑 linux 在 arm 架构上是必须要有 initramfs 才能启动,而我想找到一个方法可以不使用 initramfs 来启动以加快启动速度。