u-boot unmatched dtb does not match kernel dtb

Bug #1925267 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
u-boot (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
William Wilson
u-boot-menu (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Without the fix, Unmatched images will not boot in qemu

[Test Case]

 * `qemu-system-riscv64 \
        -machine virt -nographic -m 2048 -smp 4 \
        -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
        -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
        -device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \
        -drive file=<unmatched image file>,format=raw,if=virtio`
 * Observe that the above command fails to boot the image in qemu
 * Build a new unmatched image with the version of u-boot-menu
   and u-boot in -proposed. Both are needed.
 * Re-run the above qemu command on the new image, and observe
   that it boots
 * Also boot the new image on HiFive Unmatched hardware to ensure it
   boots.

[Regression Potential]
  While multiple hardware platforms use u-boot, the only Ubuntu
  image using u-boot-menu is the Unmatched. The risk of regression
  is therefore very low, and only the hardware boot and qemu boot
  need to be tested.

[Original Description]
u-boot unmatched dtb does not match kernel dtb

We have reverted u-boot-menu upload and stopped using kernel provided dtbs, because that was preventing booting hirsute images under qemu. As dtb generated by qemu should be used, and there is no kernel provided dtb for qemu platform.

This resulted in unamtched board using dtb provided by u-boot, instead of loading and using dtb provided by the kernel builds.

There are differences between u-boot & kernel dtbs that potentially break compat.

There are two ways of fixing this:

1) bring uboot dtb in-line with the kernel dtb

2) fix qemu uboot to not load dtbs from disk, even when extlinux.conf asks to; and resume loading the matching kernel dtb from disk

Option 1) sounds easier for release.

The diff between u-boot's unmatched dtb & kernel provided dtb is at https://paste.ubuntu.com/p/YGKCvVM6yz/

Related branches

Changed in u-boot (Ubuntu):
milestone: none → ubuntu-21.04
tags: added: block-proposed-hirsute
tags: added: block-proposed
Iain Lane (laney)
tags: removed: block-proposed block-proposed-hirsute
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot - 2021.01+dfsg-3ubuntu8

---------------
u-boot (2021.01+dfsg-3ubuntu8) hirsute; urgency=medium

  * Skip processing fdtdir on qemu-riscv64_smode target, as it crashes the
    riscv qemu VM. LP: #1925267 LP: #1923162

 -- Dimitri John Ledkov <email address hidden> Wed, 21 Apr 2021 01:25:13 +0100

Changed in u-boot (Ubuntu):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Proposed package upload rejected

An upload of u-boot to focal-proposed has been rejected from the upload queue for the following reason: "Please see https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/1923162/comments/13 for the rationale. Might need some more work or re-upload.".

Changed in u-boot (Ubuntu Focal):
assignee: nobody → William Wilson (jawn-smith)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Dimitri, or anyone else affected,

Accepted u-boot into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/u-boot/2021.01+dfsg-3ubuntu0~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in u-boot (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Dimitri, or anyone else affected,

Accepted u-boot-menu into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/u-boot-menu/4.0.2ubuntu5~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in u-boot-menu (Ubuntu):
status: New → Fix Released
Changed in u-boot-menu (Ubuntu Focal):
status: New → Fix Committed
Revision history for this message
William Wilson (jawn-smith) wrote :

The verification passed for focal. The daily images are building with u-boot-menu-4.0.2ubuntu5~20.04.1 and u-boot-sifive-2021.01+dfsg-3ubuntu0~20.04.1. I have successfully booted these daily images in qemu and on Unmatched hardware.

Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-29-generic riscv64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  System information as of Tue Jul 20 17:31:58 UTC 2021

  System load: 0.89
  Usage of /: 82.1% of 3.22GB
  Memory usage: 9%
  Swap usage: 0%
  Processes: 114
  Users logged in: 0
  IPv4 address for eth0: 10.0.2.15
  IPv6 address for eth0: fec0::5054:ff:fe12:3456

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.

Last login: Fri Jul 16 13:46:13 UTC 2021 on ttyS0
ubuntu@ubuntu:~$ apt-cache policy u-boot-menu
u-boot-menu:
  Installed: 4.0.2ubuntu5~20.04.1
  Candidate: 4.0.2ubuntu5~20.04.1
  Version table:
 *** 4.0.2ubuntu5~20.04.1 500
        500 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main riscv64 Packages
        100 /var/lib/dpkg/status
     4.0.1ubuntu0.1 500
        500 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe riscv64 Packages
     4.0.1 500
        500 http://ports.ubuntu.com/ubuntu-ports focal/universe riscv64 Packages
ubuntu@ubuntu:~$ apt-cache policy u-boot-sifive
u-boot-sifive:
  Installed: 2021.01+dfsg-3ubuntu0~20.04.1
  Candidate: 2021.01+dfsg-3ubuntu0~20.04.1
  Version table:
 *** 2021.01+dfsg-3ubuntu0~20.04.1 500
        500 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main riscv64 Packages
        100 /var/lib/dpkg/status
     2020.10+dfsg-1ubuntu0~20.04.2 500
        500 http://ports.ubuntu.com/ubuntu-ports focal-updates/main riscv64 Packages

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot - 2021.01+dfsg-3ubuntu0~20.04.1

---------------
u-boot (2021.01+dfsg-3ubuntu0~20.04.1) focal; urgency=medium

  * SRU of 2021.01+dfsg-3 from hirsute to enable booting on HiFive Unmatched
    LP: #1934791, LP: #1925267, LP: #1923162

  [ Dimitri John Ledkov ]
  * Import meta-sifive u-boot patches.
  * Enable sifive_hifive_unmatched_fu740 target.
  * Build-depend on opensbi with fu740 errata fix.
  * Set default FDT files for the sifive boards.
  * Set USE_PREBOOT on unmatched board too (just like unleashed & qemu),
    otherwise u-boot's fdtfile from itb is not used (i.e. when
    extlinux.conf does not specify fdtdir). LP: #1923162
  * Unapply unmatched patches, whilst building unleashed platform. Fixes
    failure to boot from sd-card on Unleashed. LP: #1924761
  * sifive-unleashed-default-fdt-files.patch: split into unleashed &
    unmatched separate patches, for ease of upstreaming to meta-sifive and
    u-boot upstreams. Also this ensures that unleashed target is built
    with fdtfile= set, as unleashed target unapplies lots of patches.
  * Apply upstreamed patch "cmd: pxe_utils: sysboot: fix crash if either
    board or soc are not set." This fixes a crash booting any
    extlinux.conf with fdtdir specified, and dtbfile not set and
    "soc"/"board" not set in the environment LP: #1923162

  [ William 'jawn-smith' Wilson ]
  * Re-added d/p/lzo-to-lzno.patch as lzop is in universe prior to Groovy
  * Updated d/targets for compatibility with focal arm-trusted-firmware
  * Updated d/control for compatibility with focal debhelper
  * Reinstate rpi-config-migration script for focal
  * Prevent stripping of qemu binaries under focal where strip doesn't
    recognize the format

  [ Dave Jones ]
  * In d/control update opensbi dependency for focal

 -- William 'jawn-smith' Wilson <email address hidden> Fri, 25 Jun 2021 18:21:47 +0000

Changed in u-boot (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for u-boot has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot-menu - 4.0.2ubuntu5~20.04.1

---------------
u-boot-menu (4.0.2ubuntu5~20.04.1) focal; urgency=medium

  * SRU changes from hirsute to enable booting on the HiFive Unmatched
    LP: #1925267 LP: #1923162

u-boot-menu (4.0.2ubuntu5) hirsute; urgency=medium

  * Go back to generating fdtdir option in extlinux.conf, instead patch
    u-boot qemu-riscv64_smode target to not process or load fdtdir
    option. Currently the dtb for riscv64 unmatched board in kernel &
    u-boot are _unmatched_ meaning u-boot must use its dtb, and kernel
    must use its dtb. Hence fdtdir option in extlinux.conf is
    required. LP: #1925267 LP: #1923162

u-boot-menu (4.0.2ubuntu4) hirsute; urgency=medium

  * Revert "Add support for ubuntu kernels location of device trees." as
    it breaks booting riscv64 images with qemu, as the qemu in-ram dtb
    should be used not the one from disk. LP: #1923162

u-boot-menu (4.0.2ubuntu3) hirsute; urgency=medium

  * Add support for ubuntu kernels location of device trees.

u-boot-menu (4.0.2ubuntu2) hirsute; urgency=medium

  * Make default U_BOOT_PARAMETERS to be "ro earlycon". If one is using
    embedded boards, most likely they want verbosity.

u-boot-menu (4.0.2ubuntu1) hirsute; urgency=medium

  * u-boot-update: use PRETTY_NAME from os-release as menu label.

u-boot-menu (4.0.2) unstable; urgency=medium

  [ Vagrant Cascadian ]
  * install example script for syncing .dtb files
    for systems with a split /boot partition
  * fix comment handling in in /etc/fstab

  [ Jonas Smedegaard ]
  * declare compliance with Debian Policy 4.5.0
  * use debhelper compatibility level 13 (not 10);
    build-depend on debhelper-compat (not debhelper)
  * copyright: extend coverage

 -- William 'jawn-smith' Wilson <email address hidden> Thu, 24 Jun 2021 16:04:00 -0500

Changed in u-boot-menu (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.