starfive-tech/u-boot

Distro Boot Broken

zhaofengli opened this issue · 1 comments

In the U-Boot shipped with VisionFive boards, environment variables required for Distro Boot (scriptaddr, kernel_addr_r, etc.) are not defined, so the normal boot paths (extlinux.conf, boot.scr, EFI) are broken:

Scanning mmc 0:3...
Found U-Boot script /boot.scr
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
## Executing script at 80200000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
Found /boot/extlinux/extlinux.conf
Invalid pxefile address: /boot/extlinux/extlinux.conf
SCRIPT FAILED: continuing...

(boot_a_script does load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script} which doesn't work because scriptaddr is empty, same for boot_extlinux and boot_efi_binary)

The Fedora image works around this by having a uEnv.txt in mmc 0:3 (hardcoded here in U-Boot) which sets bootcmd along with platform-specific offsets, bypassing Distro Boot. This isn't ideal since it forces a specific partition layout and requires the build to be board-specific. In the (distant) future, we would like to have a shared SD image that boots via normal UEFI on multiple RISC-V platforms.

Please set the expected variables in CONFIG_EXTRA_ENV_SETTINGS (ex: HiFive Unmatched) so that normal distro boot works.


Version: U-Boot 2022.01-rc4-VisionFive-g0c08d335c5 (Dec 30 2021 - 08:30:15 +0800)StarFive

zorun commented

I had the same issue, here is a fix: #31