flash-kernel postrm.d script fails on kernel removal

Bug #1626848 reported by Robert C Jennings
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Context: livecd-rootfs build for ARM64 ubuntu images using the linux-generic kernel

What changed: linux-image-generic-extra-* came into being and now linux-image-generic-* depends on it. When removed the zz-flash-kernel hook for the kernel runs twice (postinst.d and postrm.d)

What happened:
 - Creating a container image (LXD, ...) livecd-rootfs starts with a server image with a kernel and removes the kernel.
 - The kernel postinst.d hook for flash-kernel (zz-flash-kernel) runs twice now (first for postinst and then for postrm). On the second call there is no kernel installed and flash-kernel does not handle being called with no kernel present; the kernel removal operation fails at this point.

Looking for a solution where zz-flash-kernel/flash-kernel is tolerant of this behavior such that kernel removal is possible.

Revision history for this message
Robert C Jennings (rcj) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

The presence of a flash-kernel deb on a system is meant to imply that kernel installations/removal/upgrades should update the bootloader state. When using image building tools, flash-kernel's behavior needs to be entirely disabled, much like daemons shouldn't be started in such a chroot. To disable flash-kernel's behavior, set FLASH_KERNEL_SKIP=1 in the environment.

Another approach used commonly by image building tools is to dpkg-divert binaries (e.g. start-stop-daemon) to avoid services from being started; a similar approach could be taken to disable flash-kernel.

Revision history for this message
Robert C Jennings (rcj) wrote :

Loïc, thank you. We will use FLASH_KERNEL_SKIP in the build.

Changed in flash-kernel (Ubuntu):
importance: Critical → Undecided
Loïc Minier (lool)
Changed in flash-kernel (Ubuntu):
status: New → Invalid
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.