AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1068419
Accepted
FalcoGer
FalcoGer
Asked: 2018-08-24 22:33:40 +0800 CST2018-08-24 22:33:40 +0800 CST 2018-08-24 22:33:40 +0800 CST

无法使用 UBoot + Grub 从 USB 驱动器启动树莓派 3b

  • 772

我已成功将 Ubuntu 18.04 安装到 SD 卡上。为此,我创建了一个 msdos 分区表(pi 不支持 guid),然后将 U-Boot 放到分区 1 上的 SD 卡上(fat32,pi 不支持其他任何东西)。然后我将pi-bootloader粘贴到分区 1 /。然后我也将网络安装程序(mini-iso)中的文件复制到该分区上。整个过程都在这里展开。

SD 卡一切正常。UBoot 启动,然后加载网络安装程序 mini iso 附带的 grub2。反过来,我已经更改了配置,因此它从分区 3 加载了 linux 内核(在我的情况下,p2 是交换)。

所以我拉了一张图片,把它放在一个 USB 驱动器(usb 到 m2 sata 适配器)上,它应该就像任何其他闪存驱动器一样。所以,我打开它。U 启动启动,我没有看到任何与正常不同的地方。然后它加载 grub。但是,它没有显示带有启动 ubuntu 或安装它的选项的漂亮菜单(因为网络安装程序的东西仍然在那里),而是直接将我转储到 grub 控制台。

输入 ls I get (memdisk),仅此而已。它似乎没有找到它实际从自身加载的 USB 驱动器。在那个 memdisk 上是一个位于 (memdisk)/boot/grub/grub.cfg 的文件,但我无法知道其中的实际内容。编辑:(memdisk)也在sd卡上,内容相同,它也只列出了sd卡上的分区,而不是在闪存驱动器上。

没有 grub 模块,什么都没有。我认为它曾短暂地向我闪现错误,但随后 grub 控制台打开,我没有时间阅读这些消息。

我不知道该怎么做。也许如果我使用此处描述的 USB 模块制作自己的 grub 映像(使用 grub-mkimage 在内存磁盘中创建带有模块的 grub 映像)?虽然我不知道我需要哪些模块,或者这是否是正确的方法。

任何帮助将不胜感激。

编辑:我发现了这个:

基本上,您需要 grub 模块(我没有)才能让 grub 识别 USB 驱动器。

简短的回答是:

insmod usbms insmod ehci insmod uhci insmod ohci

只需要 *hci 行之一(通常是 ehci),但较旧的机器可能需要 uhci 或 ohci 插入所有 3 个工作正常。

这些行应该添加到非 USB 驱动器上 /boot/grub/ 文件夹中的 grub.cfg 或 custom.cfg(我推荐后者)。

我从这里得到了我的模块,但是 usbms 不在其中,[e,u,o]hci 也不在其中。我发现这是关于编写 grub 模块的,但这让我感到困惑。而且我找不到源代码。使用像 armhf 64 位处理器这样奇怪的东西并不容易找到兼容的软件。

Edit2:我已经从http://git.savannah.gnu.org/git/grub.git/下载了 grub 源代码,并在我的树莓派上编译了它。但是 usbms.c 和 ehci.c 源代码文件在那里,它没有将它们编译成 grub 模块。

我在这里找到了有关如何构建 grub 模块的信息,但它对我不起作用。我尝试更改 Makefile.core.am 并删除 usbms.module 周围的 if 语句,然后运行 ​​autogen 和 configure。没有骰子。我尝试使用 make usbms.module 在 grub-core 中手动构建,但它显示 gcc: fatal error: no input files。

我不需要蛴螬。我只想启动我的 Ubuntu arm64。如果我能以某种方式从你直接跳到那里,那很好。

我目前的想法:

  • 编译 usbms.mod、ehci.mod、uhci.mod 和 ohci.mod,使用链接的这些模块制作一个新的 grub 映像,它应该只适用于当前的 grub 配置。
  • 使用作为 memdisk 内置的模块、配置和 linux 内核和 initramfs 制作一个新的 grub 映像。使用指示 rootfs 在分区 3 上的命令行从那里引导内核
  • 不知何故,告诉 uboot 使用分区 3 是 root 的命令行从 partition3 引导我的 linux 内核。
  • 使用树莓派固件附带的黑魔法引导加载程序。我一点也不知道这些东西是如何工作的,但是如果有人可以让它启动我的 ubuntu x64,那么我很乐意忽略我不知道它是如何工作的事实。

我不知道该怎么做。

grub2 boot usb-drive bootloader
  • 1 1 个回答
  • 2011 Views

1 个回答

  • Voted
  1. Best Answer
    FalcoGer
    2018-09-12T23:11:01+08:002018-09-12T23:11:01+08:00

    您可以将 ubuntu 安装到 sd 卡上,然后将 uboot (kernel8.img) 换成新内核,例如https://github.com/sakaki-/bcmrpi3-kernel 现在您可以像在 raspbian 中一样配置 cmdline.txt,例如

    dwc_otg.lpm_enabled=0 root=PARTUUID=12345678-03 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    

    然后您可以复制 raspbian config.txt,例如

    # For more options and information see
    # http://rpf.io/configtxt
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    #hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    #dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on
    
    # Uncomment this to enable the lirc-rpi module
    #dtoverlay=lirc-rpi
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835) dtparam=audio=on
    
    program_usb_boot_mode=1
    

    添加

    dtoverlay=rpi-backlight
    dtoverlay=rpi-ft5406
    

    到最后,如果您有 ft5406 触摸屏并在 /etc/modules-load.d/ft5406.conf 中加载内核模块

    rpi_backlight
    rpi_ft5406
    

    它只是工作

    • 0

相关问题

  • 更改 Wubi 的启动顺序

  • 如何使文件夹与外部 USB 硬盘保持同步?

  • 如何在 Ubuntu 启动时显示或隐藏启动消息?

  • 如何避免启动时出现“S to Skip”消息?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve