flash-kernel fails on QEMU

Bug #1980519 reported by Heinrich Schuchardt
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

http://cloud-images.ubuntu.com/kinetic/current/kinetic-server-cloudimg-riscv64.img contains package flash-kernel. When running on QEMU updating the initramfs leads to an error:

Processing triggers for initramfs-tools (0.140ubuntu13) ...
update-initramfs: Generating /boot/initrd.img-5.17.0-1003-starfive
Unsupported platform 'riscv-virtio,qemu'.
run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
needrestart is being skipped since dpkg has failed

Either flash-kernel should be removed from the image or flash kernel should be changed to ignore the unsupported platform.

Patching flash-kernel seems preferable.

Tags: fr-2517
tags: added: fr-2517
Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Changed in flash-kernel (Ubuntu):
status: New → Confirmed
Revision history for this message
Dave Jones (waveform) wrote :

I'm a bit concerned that we're squashing an error case that seems legitimate to me? There's several cases of "dummy" entries in flash-kernel's all.db for QEMU instances under various architectures. For example:

  https://git.launchpad.net/ubuntu/+source/flash-kernel/tree/db/all.db#n407
  ## qemu instance on armhf
  Machine: Dummy Virtual Machine

  https://git.launchpad.net/ubuntu/+source/flash-kernel/tree/db/all.db#n983
  ## qemu instance on arm64
  Machine: linux,dummy-virt

I'd be happy to add one of these for the QEMU RISC-V machine (which, from our mm conversation would be "Machine: riscv-virtio,qemu".

However, to change "functions" so that, in the case flash-kernel doesn't recognize the machine type, it stops but *doesn't* stop apt upgrade seems too invasive to me. It is indeed serious that flash-kernel breaks apt upgrade in this case, but it seems justified to me: the new kernel and initrd will be installed in the boot directory by this point, and the kernel (or initramfs-tools) packaging will have triggered flash-kernel with the expectation it flashes the new kernel+initrd(+bootloader machinery) to wherever it needs to be for this particular board. If flash-kernel *can't* do that (because it doesn't recognize the board), is that not legitimate grounds to stop apt so the user knows they're in a pretty serious situation?

To put it another way, I'd be happy to sponsor a change adding a dummy entry to all.db (I'm also happy to just add that diff myself and push it right away), but I'm concerned that the proposed diff affects more than just QEMU RISC-V instances, and does so in ways that change error behaviour in situations which seem like they should remain error situations to me.

Revision history for this message
Dave Jones (waveform) wrote :

After some discussion on mattermost, we've agreed the additional Machine entry should be sufficient to proceed with RISC-V on QEMU for now; I'll upload a fix for this in a mo.

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

This bug was fixed in the package flash-kernel - 3.106ubuntu2

---------------
flash-kernel (3.106ubuntu2) kinetic; urgency=medium

  * db/all.db: add dummy entry for RISC-V under QEMU (LP: #1980519)

 -- Dave Jones <email address hidden> Wed, 06 Jul 2022 11:25:53 +0100

Changed in flash-kernel (Ubuntu):
status: Confirmed → Fix Released
Changed in flash-kernel (Ubuntu):
status: Fix Released → Fix Committed
Changed in flash-kernel (Ubuntu):
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.