Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
wniming
V2EX  ›  Linux

Linux 内核在 arm 架构下启动是不是必须要 initramfs?

  •  
  •   wniming · Mar 13, 2023 · 2075 views
    This topic created in 1183 days ago, the information mentioned may be changed or developed.

    由于我要加快系统的启动速度,所以想省去 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 来启动以加快启动速度。

    7 replies    2023-03-13 16:20:38 +08:00
    pagxir
        1
    pagxir  
       Mar 13, 2023 via Android
    不是。
    podel
        2
    podel  
       Mar 13, 2023
    不是。 我最近编译了一个 ARM UEFI 启动的 OPENWRT 系统。
    这个就是 启动的时候单内核。 然后 wait root filesystem 。继续加载启动了。
    huangya
        3
    huangya  
       Mar 13, 2023
    b 不是。可以接启动参数 root=
    wniming
        4
    wniming  
    OP
       Mar 13, 2023
    应该是我之前哪里设置错了,现在问题解决了
    yanqiyu
        5
    yanqiyu  
       Mar 13, 2023
    看起来更像是你的 sda 对应的文件系统驱动没有被编译进内核
    wniming
        6
    wniming  
    OP
       Mar 13, 2023
    @yanqiyu 昨天搞了好久没解决,今天不知道改了那里问题没了
    cy18
        7
    cy18  
       Mar 13, 2023
    1. 检查启动参数,“root=”配置对不对。
    2. 检查驱动,包括设备驱动,文件系统驱动,是不是编译进内核了。
    3. 不涉及机密的话建议发完整的,包括 uboot 部分的 log 上来。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5453 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 08:55 · PVG 16:55 · LAX 01:55 · JFK 04:55
    ♥ Do have faith in what you're doing.