Comment 12 for bug 2007827

Revision history for this message
satmandu (satadru-umich) wrote : Re: flash-kernel failure when upgrading f-k anad kernel in the same cycle

I've been generating kernel images with this script from the raspberry pi foundation kernels for some time:

https://gist.github.com/satmandu/a507c59d84737f6d29ff353395819d51

flash-kernel gives me this error now in lunar:

Using DTB: bcm2711-rpi-4-b.dtb
Installing /etc/flash-kernel/dtbs/bcm2711-rpi-4-b.dtb into /boot/dtbs/6.1.16-v8+/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
dpkg-query: no packages found matching

I've had to modify /var/lib/dpkg/info/flash-kernel.postinst to have "exit 0" at the end, and I've also modified the beginning to replace "set -e" with "set -x" to get some more info on what's happening.

Trying to install the latest generated image, I get this error:

Setting up linux-image-6.1.16-v8+ (6.1.16-v8+-1) ...
Processing triggers for linux-image-6.1.16-v8+ (6.1.16-v8+-1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.1.16-v8+
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.1.16-v8+
Using DTB: bcm2711-rpi-4-b.dtb
Installing /etc/flash-kernel/dtbs/bcm2711-rpi-4-b.dtb into /boot/dtbs/6.1.16-v8+/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
Using DTB: bcm2711-rpi-4-b.dtb
Installing /etc/flash-kernel/dtbs/bcm2711-rpi-4-b.dtb into /boot/dtbs/6.1.16-v8+/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.106ubuntu13) ...
+ [ xtriggered = xtriggered ]
+ FLASH_KERNEL_NOTRIGGER=y flash-kernel
Using DTB: bcm2711-rpi-4-b.dtb
Installing /etc/flash-kernel/dtbs/bcm2711-rpi-4-b.dtb into /boot/dtbs/6.1.16-v8+/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
dpkg-query: no packages found matching
+ exit 0

(without the exit 0, flash-kernel always quits with an error, leaving the install of the kernel broken.)

I can't tell if the flash-kernel breakage is connected to this change or not... but I can't understand why there is a dpkg-query error here.

I do see this:
 dpkg-query -l linux-image-6.1.16-v8+
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================-============-============-=================================
ii linux-image-6.1.16-v8+ 6.1.16-v8+-1 arm64 Linux kernel, version 6.1.16-v8+