On 2025-04-12, Johannes Schauer Marin Rodrigues wrote:
> $ apt-cache policy linux-image-arm64
> linux-image-arm64:
>   Installed: 6.12.19-1+reform20250322T135019Z
>   Candidate: 6.12.22-1+reform20250411T222458Z
...
> $ sudo apt full-upgrade
...
> Removing linux-headers-6.12.16-mnt-reform-arm64 
> (6.12.16-1+reform20250219T175041Z) ...
...
> flash-kernel: A higher version (6.12.19-mnt-reform-arm64) is still installed, 
> no reflashing required.
...
> Setting up linux-image-6.12.22-mnt-reform-arm64 
> (6.12.22-1+reform20250411T222458Z) ...
...
> Installing 
> /usr/lib/linux-image-6.12.22-mnt-reform-arm64/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
>  into 
> /boot/dtbs/6.12.22-mnt-reform-arm64/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
...
> Setting up flash-kernel (3.109+reform1) ...

So, at this point, you had 6.12.19 and 6.12.22 installed, 6.12.16 was
removed ... and flash-kernel was just updated ... without re-running the
flash-kernel scripts for 6.12.22 ... although the "Installing
/usr/lib/linux-image-6.12.22...reform.dtb" was from (the older?)
flash-kernel, no?


> ===========================================
>                  REBOOT
> ===========================================
>
>
> $ uname -a
> Linux kodi 6.12.19-mnt-reform-arm64 #1 SMP Debian 
> 6.12.19-1+reform20250322T135019Z (2025-03-22) aarch64 GNU/Linux

And because flash-kernel was not run for 6.12.22, you end up booted to
6.12.19?


> $ sudo apt remove linux-image-6.12.19-mnt-reform-arm64 
> linux-headers-6.12.19-mnt-reform-arm64
> [...]
> /etc/kernel/postrm.d/zz-flash-kernel:
> Using DTB: amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
> flash-kernel: Kernel 6.12.19-mnt-reform-arm64 has been removed.
> flash-kernel: A higher version (6.12.22-mnt-reform-arm64) is still
> installed, no reflashing required.

hrm... This makes my head spin. And not in a good way. :/


> $ grep -a 6.12.19 /boot/boot.scr
>    setenv fk_kvers '6.12.19-mnt-reform-arm64'
> $ sudo flash-kernel
> Using DTB: amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
> Installing 
> /usr/lib/linux-image-6.12.22-mnt-reform-arm64/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
>  into 
> /boot/dtbs/6.12.22-mnt-reform-arm64/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dtb
> Taking backup of meson-g12b-bananapi-cm4-mnt-reform2.dtb.
> Installing new meson-g12b-bananapi-cm4-mnt-reform2.dtb.
> flash-kernel: installing version 6.12.22-mnt-reform-arm64
> Generating boot script u-boot image... done.
> Taking backup of boot.scr.
> Installing new boot.scr.
> $ grep -a 6.12.22 /boot/boot.scr
>    setenv fk_kvers '6.12.22-mnt-reform-arm64'

Ok.


> Luckily, running flash-kernel manually fixed the issue. But had I not noticed
> that /boot/boot.scr still contained a version of a kernel that I had just
> removed, my system would've become unbootable.

Presuming this isn't some bizarre fluke, then this bug is likely present
in most versions of flash-kernel, as that code has not been touched for
at least a 2-5 years...

I vaguely recall a bug or merge request coming from Ubuntu that might be
related...


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to