Building armhf and arm64 Raspberry Pi 3 images

Bug #1805668 reported by Łukasz Zemczak on 2018-11-28
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned
raspi3-firmware (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned
u-boot (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned

Bug Description

[Impact]

One of our long-term goals is to support the same set of platforms for both classical Ubuntu and ubuntu-core. We currently provide official images for the Raspberry Pi 3 for both the core16 and core18 bases but do not provide the same for Ubuntu classic.
Since it's a 'feature' we're essentially lacking since long, we want to have the new device also supported in our current LTS (bionic).

[Fix]

For the classic raspi3 support we will be using the ubuntu-image classic image building tool which is specifically designed for creating preinstalled images. The support for that has already been SRUed in the latest ubuntu-image.
For the full image build support to be complete, the following list of changes need to be backported (SRUed) into the respective stable series:

 * livecd-rootfs - all the changes regarding classic image build, gadget tree selection and raspi3 rootfs generation.
 * u-boot - bionic will need to be updated to at least 2018.03+dfsg1-2ubuntu2.
 * raspi3-firmware (bionic only) - needs to be updated to at least the version we have in cosmic. Without this change, the console is flooded with firmware error messages every 2 seconds.
 (vorlon) this should be updated specifically to the version of raspi3-firmware that we are using in the gadget snap - currently 1.20180919 - and not to another.

[Test Case]

 * Run a bionic livefs build of raspi3+armhf with proposed enabled (IMAGEFORMAT=ubuntu-image and PROJECT=ubuntu-cpc), make sure the build succeeds and that the resulting image boots on a raspi3.
 * Run a bionic livefs build of raspi3+arm64 with proposed enabled (IMAGEFORMAT=ubuntu-image and PROJECT=ubuntu-cpc), make sure the build succeeds and that the resulting image boots on a raspi3.
 * Make sure that none of the other bionic daily images fail to build

[Regression Potential]

There is some potential that an invalid backport of livecd-rootfs functionality could result in the inability to create new ubuntu-core images or any of the other existing flavors. But in case of such a regression we would see it instantly after the package lands in bionic-proposed as we are building daily images with -proposed enabled. As for the other packages, there probably is some regression potential, but since the versions are backports from disco/cosmic, the risk is probably very small.

description: updated
Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
Changed in raspi3-firmware (Ubuntu):
status: New → Fix Released
Changed in u-boot (Ubuntu):
status: New → Fix Released
Changed in livecd-rootfs (Ubuntu Cosmic):
status: New → Won't Fix
Łukasz Zemczak (sil2100) wrote :

I have skipped uploading the livecd-rootfs changes for cosmic as we are not planning on enabling raspi3 images for this distro-series as far as I know. This package is only used during build time so there is no reason to worry about missing functionality.

Adam Smith (adamsmith) wrote :

A bit confused by this bug. Ubuntu doesn't use raspi3-firmware. The package used is linux-firmware-raspi2. I also think there is a high regression potential with the uboot/firmware packages - what happens to the people using Ryan Finnie's unofficial images?

Whilst an image that works with the pi 3 is welcome, Ubuntu should be producing one pi image that works with all boards. See https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1765628

Adam Smith (adamsmith) wrote :

Recently the 3A+ was released https://www.raspberrypi.org/magpi/pi-3a-interview/ so this should be supported too in any new builds.

Adam Smith (adamsmith) wrote :

The raspi3 additions to livecd-rootfs are just wrong. Is the use of raspi3-firmware intentional?
If it is you've got pi2 and pi3 having completely different booting. The config.txt created by livecd-rootfs will be overwritten by raspi3-firmware. Which is not necessarily bad, because the config.txt wouldn't work with arm64 anyway.

Adam Smith (adamsmith) wrote :

I don't agree with the alterations to u-boot either. Arm64 doesn't need to be called kernel8.img. The config.txt should be changed to tell the pi's bootloader to expect aarch64. That way you can keep the uboot.bin name and it is consistent between armhf and arm64.

This bug fails to address flash-kernel which is the major problem with the ubuntu setup. raspi3-firmware is not the answer - it is awful. What is required is a new package with simplified scripts that replaces Linux-firmware-raspi2. Making big changes to existing packages is very risky.

Before backporting any changes to bionic please be aware of how people are using Ubuntu - https://wiki.ubuntu.com/ARM/RaspberryPi . Different versions of u-boot could be used, requiring different FDT addresses. Or more likely, u-boot is not used at all. Previously updates to u-boot/flash-kernel/Linux-firmware-raspi2 have caused major problems (e.g. https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1652270 ). We definitely don't want some packages postinst script messing with config.txt.

Adam Smith (adamsmith) wrote :

One of the good things about Raspbian is it is able to run on any Pi. You can take an SD card out of a Pi2 and it will work in a Pi3B+ or vice versa. This is definitely what Ubuntu should be aiming for and it is not hard to implement.

Adam Smith (adamsmith) wrote :

If Ubuntu has to continue with u-boot (and I don't know why it does), then it should implement the recent improvements i.e. you don't have to specify a FDT address.

Steve Langasek (vorlon) on 2018-12-04
description: updated

Hello Łukasz, or anyone else affected,

Accepted livecd-rootfs into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.525.11 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 livecd-rootfs (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Adam Smith (adamsmith) wrote :

Not sure why something that is clearly broken should be accepted?

Adam Smith (adamsmith) wrote :

To answer the description update by vorlon: The raspi3-firmware package contains scripts that get run on a kernel update. This creates a new config.txt and makes copies of kernel/dtb etc. Pretty certain this is not how gadget snaps work (the firmware is obtained directly from git is it not?). U-boot will be by-passed by raspi3-firmware.

Oliver Grawert (ogra) wrote :

@steve note that we will have to update to u-boot v2018.11 and rpi firmware tag 1.20180924 to support the recently released pi3b A+, i was planning to land a change for this soon in the gadget.

On Tue, Dec 04, 2018 at 09:49:17AM -0000, Adam Smith wrote:
> To answer the description update by vorlon: The raspi3-firmware package
> contains scripts that get run on a kernel update. This creates a new
> config.txt and makes copies of kernel/dtb etc. Pretty certain this is
> not how gadget snaps work (the firmware is obtained directly from git is
> it not?). U-boot will be by-passed by raspi3-firmware.

The fact that gadget snaps don't use the same scripts as contained in the
raspi3-firmware package is orthogonal to the question of keeping Ubuntu Core
and Ubuntu Classic in sync with respect to the firmware bits being used.

Steve Langasek (vorlon) wrote :

On Tue, Dec 04, 2018 at 10:10:58AM -0000, Oliver Grawert wrote:
> @steve note that we will have to update to u-boot v2018.11 and rpi
> firmware tag 1.20180924 to support the recently released pi3b A+, i was
> planning to land a change for this soon in the gadget.

Ok, but it hasn't landed yet and that's not the version that's been tested
with our kernel yet, so that's not the version we should currently be
SRUing.

Adam Smith (adamsmith) wrote :

Ubuntu core and classic haven't been in sync for over a year. Linux-firmware-raspi2 and the pi2 gadget use different versions of the firmware. The pi2 v1.2 is closer to the pi3b than the original pi2. Pegging the version of firmware for the pi2 makes little sense, stopping usb booting for example.

Adam Smith (adamsmith) wrote :

It's not just me who thinks raspi3-firmware is "useless for many users" - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848101

Adam Smith (adamsmith) wrote :

Also, raspi3-firmware was intended for use with the generic kernel. The Debian generic kernel can be booted directly by the pi firmware (unlike Ubuntu's which needs the assistance of u-boot/grub2). Consequently the scripts expect different dtb names to those used by the linux-raspi2 kernel.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in raspi3-firmware (Ubuntu Bionic):
status: New → Confirmed
Changed in raspi3-firmware (Ubuntu Cosmic):
status: New → Confirmed
Changed in u-boot (Ubuntu Bionic):
status: New → Confirmed
Changed in u-boot (Ubuntu Cosmic):
status: New → Confirmed
Adam Smith (adamsmith) wrote :

But 1806813 contains results from some early testing.

Adam Smith (adamsmith) wrote :

That should of read bug 1806813 !

DavidT (dtischler) wrote :

As noted by Adam, my experience is documented in #1806813. As a quick summary, I am attempting to boot the new 64-bit Arm Server image located at http://cdimage.ubuntu.com/releases/18.04/beta/ on a Compute Module 3. I know that Ubuntu Core is supported on the Compute Module 3, but, Classic is preferred for this project. I have actually gotten it booting with the changes Adam pointed out in that thread, but it would be nice if the CM3 was supported out-of-the-box with this image. Thank is advance!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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