Support both armhf and arm64 raspi3 in flash-kernel

Bug #1811216 reported by Łukasz Zemczak on 2019-01-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
High
Unassigned
Bionic
Critical
Unassigned
Cosmic
Low
Unassigned

Bug Description

[Impact]

Currently the boot.scr provided by flash-kernel for rpi3 uses bootz for booting the kernel, an uboot command that only works for armhf kernels. This means that in case the boot.scr on a pi3 arm64 gets updated on upgrade, the system will stop booting. Easiest way is to support separate bootscripts for arm64 and armhf.
Also, to fully support all the strange cases for arm64, the boot address parameters need to be adjusted for a bigger kernel. The arm64 kernel, in contrast to the armhf one, is not compressed and takes up much more space in memory.

This is basically only needed for bionic as we don't intend to build raspi3 images on cosmic, but SRUs will be provided for all series.

[Test Case]

 * Boot up an arm64 based image on a raspi3 and log into it
 * Run flash-kernel
 * Check for errors
 * Check if /boot/firmware/boot.scr still has booti as its boot command
 * Reboot
 * Check if system still boots correctly

[Regression Potential]

The only regression potential is in actually making the image not booting, so running the SRU test case should validate that. There's basically no other regression potential I can think of.

Łukasz Zemczak (sil2100) wrote :

Released in disco 3.90ubuntu4.

Changed in flash-kernel (Ubuntu):
status: New → Fix Released
description: updated
Changed in flash-kernel (Ubuntu Bionic):
status: New → In Progress
Changed in flash-kernel (Ubuntu Cosmic):
status: New → In Progress
Changed in flash-kernel (Ubuntu Bionic):
importance: Undecided → Critical
Changed in flash-kernel (Ubuntu Cosmic):
importance: Undecided → High
importance: High → Low

Hello Łukasz, or anyone else affected,

Accepted flash-kernel into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.90ubuntu3.18.10.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 and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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 flash-kernel (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Brian Murray (brian-murray) wrote :

Hello Łukasz, or anyone else affected,

Accepted flash-kernel into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.90ubuntu3.18.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 and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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 flash-kernel (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Adam Smith (adamsmith) wrote :

This changes the fdt_addr_r to 0x03000000. Although the previous number did not work, I believe the fdt_addr_r will have been changed by many users. For example, Ryan Finnie's pi3 images have this set to 0x02008000. So this updated flash-kernel package will stop those images/installations booting (because the pi's config.txt will still be using the old address). This is potentially going to upset a lot of people.

Adam Smith (adamsmith) wrote :
Adam Smith (adamsmith) wrote :

Why not drop the boot.scr and use uboot.env like for the pi2 and the pi2/3 gadget snaps?

Łukasz Zemczak (sil2100) wrote :

hm, we never really officially supported the raspi3, but it is worrying to have broken users. So it is a valid concern. One way to proceed here would be to switch back the FDT address to 0x02008000 for armhf in flash-kernel and only leave it bumped in arm64 (as it's needed there). I only changed it for both because of consistency, but there are anyway differences between both boot scripts so it really doesn't matter. I'll look into getting that done.

As for boot.scr, well, in my first attempts I actually used uboot.env as well, but then saw that flash-kernel advertises it instead, so I switched (that was also what Ryan's images used IIRC). Since I had no strong preferences, I just switched to that instead.

Adam Smith (adamsmith) wrote :

Linux-firmware-raspi2 forcefully sets config.txt to use 0x02000000.

It is unnecessary to specify an address. See https://elinux.org/RPi_U-Boot#Booting_from_an_SD_card

Łukasz Zemczak (sil2100) wrote :

Currently linux-firmware-raspi2 only sets it to 0x02000000 if the device_tree_address is not present in config.txt. So in our case this is not a concern and just some technical debt that will have to be cleaned up at some point.

Łukasz Zemczak (sil2100) wrote :

Built a fresh raspi3 arm64 image through cdimage (20190122.2) containing flash-kernel 3.90ubuntu3.18.04.1. Booted up the image, logged in, ran flash-kernel, saw no errors (kernel and bootscript updated successfully), rebooted and the image was still bootable. Considering this bug as verified.

Please note that there will be a follow up flash-kernel upload later.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
tags: added: verification-needed
removed: verification-done
Łukasz Zemczak (sil2100) wrote :

I will also try to validate cosmic, but seeing that we won't have any official images for that, this doesn't seem to be really high priority.

Łukasz Zemczak (sil2100) wrote :

Did a quick sanity test of flash-kernel 3.90ubuntu3.18.10.1 using an old pre-alpha cosmic arm64 test image. I updated the package, ran flash-kernel, made sure there's no errors and rebooted the device. It booted up correctly.

tags: added: verification-done verification-done-cosmic
removed: verification-needed verification-needed-cosmic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.90ubuntu3.18.10.1

---------------
flash-kernel (3.90ubuntu3.18.10.1) cosmic; urgency=medium

  * Add Raspberry Pi 3 Model B+ to the db. (LP: #1764491)
  * Modify the Pi 3 boot.scr addresses to fit a bigger kernel, prepare
    separate versions for armhf and arm64. (LP: #1811216)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Thu, 10 Jan 2019 09:56:08 +0100

Changed in flash-kernel (Ubuntu Cosmic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for flash-kernel has completed successfully and the package has now been 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.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.90ubuntu3.18.04.1

---------------
flash-kernel (3.90ubuntu3.18.04.1) bionic; urgency=medium

  * Add Raspberry Pi 3 Model B+ to the db. (LP: #1764491)
  * Modify the Pi 3 boot.scr addresses to fit a bigger kernel, prepare
    separate versions for armhf and arm64. (LP: #1811216)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Thu, 10 Jan 2019 09:56:08 +0100

Changed in flash-kernel (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers