11-01-2024, 04:43 PM
Earlier this year, there was an update to the Linux kernel that broke booting Rock64 from their eMMC and it was necessary to force using an older, working kernel version. It's since been fixed, but in case there is again a need to boot with a kernel older than the latest, here's one way:
Drop a file in /etc/flash-kernel/ubootenv.d that forces the U-Boot environment variable fk_kvers to a working kernel version present in your /boot, then run flash-kernel to regenerate the U-Boot bootscript /boot/boot.scr
echo "env set fk_kvers 6.1.0-22-arm64" > /etc/flash-kernel/ubootenv.d/90-force-kernel-version &&
flash-kernel
When you want to stop forcing the kernel version, remove /etc/flash-kernel/ubootenv.d/90-force-kernel-version, run flash-kernel, and reboot
This works because flash-kernel rebuilds /boot/boot.scr from the template /etc/flash-kernel/bootscript/bootscr.uboot-generic, and this includes "@@UBOOT_ENV_EXTRA@@", which gets replaced by the contents of each of the files in /etc/flash-kernel/ubootenv.d/ and the boot script boots the referenced kernel
Drop a file in /etc/flash-kernel/ubootenv.d that forces the U-Boot environment variable fk_kvers to a working kernel version present in your /boot, then run flash-kernel to regenerate the U-Boot bootscript /boot/boot.scr
echo "env set fk_kvers 6.1.0-22-arm64" > /etc/flash-kernel/ubootenv.d/90-force-kernel-version &&
flash-kernel
When you want to stop forcing the kernel version, remove /etc/flash-kernel/ubootenv.d/90-force-kernel-version, run flash-kernel, and reboot
This works because flash-kernel rebuilds /boot/boot.scr from the template /etc/flash-kernel/bootscript/bootscr.uboot-generic, and this includes "@@UBOOT_ENV_EXTRA@@", which gets replaced by the contents of each of the files in /etc/flash-kernel/ubootenv.d/ and the boot script boots the referenced kernel