【问题标题】:how to add linux kernel and boot loader to an Ubuntu 14.0.4 core rootfs for Raspberry Pi2?如何将 linux 内核和引导加载程序添加到 Raspberry Pi2 的 Ubuntu 14.0.4 核心 rootfs?
【发布时间】:2016-07-01 07:37:36
【问题描述】:

正如标题所示,我正在尝试使用 Ubuntu 14.0.4 base rootfs for armhf 为我的 Raspberry-Pi2 创建一个最小的 Ubuntu 映像。

我必须自己添加内核和引导加载程序,因为我不是这个主题的专业人士,我对编译内核/U-boot 的所有不同指南感到完全困惑。找不到任何内容来涵盖整个过程并让 RPi 启动。

有没有人可以帮助我将内核和引导加载程序放到 RPi2 的 Ubuntu(核心)rootfs 上并创建可引导的 SD 卡(从头开始)?

PS:我想要一个关于整个过程的分步指南,以便我(以及像我这样的其他人)可以在本地应用它们并从头开始启动和运行 Pi2。

我有一台 Ubuntu 14.0.4 笔记本电脑作为我的主机,用于交叉编译和复制文件等。

我很绝望,谢谢!

【问题讨论】:

    标签: linux ubuntu linux-kernel raspberry-pi2 u-boot


    【解决方案1】:

    为什么不使用官方发布的here?拥有 SD 卡的一般程序是为 SD 卡设置两个分区。第一个分区将是 FAT32,您的引导加载程序、设备树 blob 和内核映像以及任何其他文件都可以驻留在其中。如果我没记错的话,RPi 在第一个分区中需要相当多的其他二进制 blob。第二个将是一个 ext 分区,您需要在其中放置 rootfs。获取任何可用的分发映像,将其写入 SD 卡并用您喜欢的任何发行版 rootfs 替换第二个 rootfs 分区。内核和设备树 blob 也可能驻留在第二个分区的 /boot 上,而不是第一个。

    我也只是快速检查了一下。我有一张 RPi3 的 SD 卡,上面有 Raspbian。我用基于 Ubuntu 的 rootfs 替换了具有来自 Raspbian 的 rootfs 的第二个分区。它启动得很好,但停在

     * Starting Mount filesystems on boot[ OK ]
     * Starting Populate /dev filesystem[ OK ]
     * Stopping Populate /dev filesystem[ OK ]
     * Starting Populate and link to /run filesystem[ OK ]
     * Stopping Populate and link to /run filesystem[ OK ]
     * Stopping Track if upstart is running in a container[ OK ]
     * Starting Initialize or finalize resolvconf[ OK ]
     * Starting set console keymap[ OK ]
     * Starting Signal sysvinit that virtual filesystems are mounted[ OK ]
     * Starting Signal sysvinit that virtual filesystems are mounted[ OK ]
     * Starting Bridge udev events into upstart[ OK ]
     * Starting device node and kernel event manager[ OK ]
     * Starting Signal sysvinit that remote filesystems are mounted[ OK ]
     * Stopping set console keymap[ OK ]
     * Starting load modules from /etc/modules[ OK ]
     * Starting cold plug devices[ OK ]
     * Starting log initial device creation[ OK ]
     * Stopping load modules from /etc/modules[ OK ]
     * Starting set console font[ OK ]
     * Stopping set console font[ OK ]
     * Starting userspace bootsplash[ OK ]
     * Starting Send an event to indicate plymouth is up[ OK ]
     * Stopping userspace bootsplash[ OK ]
     * Stopping Send an event to indicate plymouth is up[ OK ]
     * Stopping cold plug devices[ OK ]
     * Stopping log initial device creation[ OK ]
     * Starting configure network device security[ OK ]
     * Starting Mount network filesystems[ OK ]
     * Starting configure network device security[ OK ]
     * Stopping Mount network filesystems[ OK ]
     * Starting configure network device[ OK ]
     * Starting configure network device[ OK ]
     * Starting Bridge socket events into upstart[ OK ]
    The disk drive for / is not ready yet or not present.
    keys:Continue to wait, or Press S to skip mounting or M for manual recovery
    

    我没有调查原因,但我相信这是由于 /etc/fstab。

    [root@alarmpi ~]# cat /etc/fstab 
    # 
    # /etc/fstab: static file system information
    #
    # <file system> <dir>   <type>  <options>       <dump>  <pass>
    /dev/mmcblk0p1  /boot   vfat    defaults        0       0
    

    这是来自 Arch。我没有记下 Ubuntu,但它是不正确的。

    用基于 ArchLinux ARM 的 rootfs 替换 rootfs,它似乎可以正常启动。请注意,我使用了基于 Raspbian 的 SD 卡并将 rootfs 与 Arch 的交换。

    [    3.743064] systemd-journald[85]: Received request to flush runtime journal from PID 1
    [    4.791472] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
    
    Arch Linux 4.1.18-v7+ (ttyS0)
    
    alarmpi login: 
    Arch Linux 4.1.18-v7+ (ttyS0)
    
    alarmpi login: root
    Password: 
    Welcome to Arch Linux ARM
    
         Website: http://archlinuxarm.org
           Forum: http://archlinuxarm.org/forum
             IRC: #archlinux-arm on irc.Freenode.net
    [   15.258407] random: nonblocking pool is initialized
    

    我希望这能让您大致了解如何处理这个问题。

    【讨论】:

      猜你喜欢
      • 2021-10-12
      • 1970-01-01
      • 1970-01-01
      • 2011-02-01
      • 2020-09-10
      • 2021-02-28
      • 1970-01-01
      • 2016-08-18
      • 2012-03-02
      相关资源
      最近更新 更多