Package: flash-kernel
Version: 3.109+reform1
Severity: serious

Hi Vagrant,

sorry for another RC bug but had I not seen this message it would've rendered
my system unbootable. The summary is, that I installed a newer kernel, then
rebooted, then removed the old kernel. Had I not paid attention, my system
would've become unbootable because flash-kernel decided not to update my
/boot/boot.scr for the new kernel version. Here are some hopefully relevant
bits from my upgrade/reboot/removal process:

$ apt-cache policy linux-image-arm64
linux-image-arm64:
  Installed: 6.12.19-1+reform20250322T135019Z
  Candidate: 6.12.22-1+reform20250411T222458Z
  Version table:
     6.12.22-1+reform20250411T222458Z 990
        990 
https://source.mnt.re/reform/reform-debian-packages/-/jobs/8626/artifacts/raw/repo
 reform/main arm64 Packages
     6.12.22-1+reform20250411T055815Z 990
        990 https://mntre.com/reform-debian-repo reform/main arm64 Packages
     6.12.22-1 500
        500 http://deb.debian.org/debian unstable/main arm64 Packages
     6.12.21-1 500
        500 http://deb.debian.org/debian testing/main arm64 Packages
 *** 6.12.19-1+reform20250322T135019Z 100
        100 /var/lib/dpkg/status
$ sudo apt full-upgrade
[...]
Removing linux-headers-6.12.16-mnt-reform-arm64 
(6.12.16-1+reform20250219T175041Z) ...
Removing linux-image-6.12.16-mnt-reform-arm64 
(6.12.16-1+reform20250219T175041Z) ...
/etc/kernel/prerm.d/dkms:                                                       
dkms: removing module reform2_lpc/1.68 for kernel 6.12.16-mnt-reform-arm64 
(aarch64)
Module reform2_lpc/1.68 for kernel 6.12.16-mnt-reform-arm64 (aarch64):          
Before uninstall, this module version was ACTIVE on this kernel.                
Deleting /lib/modules/6.12.16-mnt-reform-arm64/updates/dkms/reform2_lpc.ko.xz   
                                                                                
Running depmod... done.                                                         
/etc/kernel/postrm.d/initramfs-tools:                                           
update-initramfs: Deleting /boot/initrd.img-6.12.16-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.16-mnt-reform-arm64 has been removed.                 
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) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.12.19-mnt-reform-arm64       
I: /initrd.img.old is now a symlink to boot/initrd.img-6.12.19-mnt-reform-arm64 
I: /vmlinuz is now a symlink to boot/vmlinuz-6.12.22-mnt-reform-arm64           
I: /initrd.img is now a symlink to boot/initrd.img-6.12.22-mnt-reform-arm64     
/etc/kernel/postinst.d/initramfs-tools:                                         
update-initramfs: Generating /boot/initrd.img-6.12.22-mnt-reform-arm64          
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
Installing new 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: deferring update (trigger activated)                              
/etc/kernel/postinst.d/zz-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.                         
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: deferring update (trigger activated)                              

[...]

Setting up flash-kernel (3.109+reform1) ...

[...]


===========================================
                 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
$ apt-cache policy linux-image-arm64
linux-image-arm64:
  Installed: 6.12.22-1+reform20250411T222458Z
  Candidate: 6.12.22-1+reform20250411T222458Z
  Version table:
 *** 6.12.22-1+reform20250411T222458Z 990
        990 
https://source.mnt.re/reform/reform-debian-packages/-/jobs/8626/artifacts/raw/repo
 reform/main arm64 Packages
        100 /var/lib/dpkg/status
     6.12.22-1+reform20250411T055815Z 990
        990 https://mntre.com/reform-debian-repo reform/main arm64 Packages
     6.12.22-1 500
        500 http://deb.debian.org/debian unstable/main arm64 Packages
     6.12.21-1 500
        500 http://deb.debian.org/debian testing/main arm64 Packages
$ dpkg -l | grep linux-image
ii  linux-image-6.12.17-mnt-reform-arm64   6.12.17-1+reform20250303T085515Z     
arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
ii  linux-image-6.12.19-mnt-reform-arm64   6.12.19-1+reform20250322T135019Z     
arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
ii  linux-image-6.12.22-mnt-reform-arm64   6.12.22-1+reform20250411T222458Z     
arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
ii  linux-image-arm64                      6.12.22-1+reform20250411T222458Z     
arm64        Linux for 64-bit ARMv8 machines (MNT Reform) (meta-meta-package)
ii  linux-image-mnt-reform-arm64           6.12.22-1+reform20250411T222458Z     
arm64        Linux for 64-bit ARMv8 machines (MNT Reform) (meta-package)
$ 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.
$ 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'


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.

This problem occurred with a patched flash-kernel but you know that we only
patch the machines file with more entries and do not patch the scripts:
https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/flash-kernel

Thanks!

cheers, josch

Reply via email to