flash-kernel postrm.d script fails on kernel removal
| 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-
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-
| Changed in flash-kernel (Ubuntu): | |
| status: | New → Invalid |

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.