Skip to content

Draft: prototype preserving old kernel versions on upgrade

Caleb Connolly requested to merge caleb/multiple-kernels into master

Add pre and post-upgrade scripts which keep the old kernel, modules, dtbs, and release file.

This allows for the kernel package to be upgraded while preserving the old version, so if the upgrade causes a regression the user can switch back.

This will need to be heavily refactored, documented and made generic.

Most likely the upgrade scripts will be moved to some -dev package and the kernel package APKBUILD will simply source a script to create the pre/post-upgrade scripts.

For this to work, the kernel release directory (/usr/share/kernel/something/) has to follow the format --r since the scripts rely on this to map the package version to the kernel suffix.

mkinitfs is now run for each installed kernel and given the kernel release as an argument (which is then passed to boot-deploy).

The initramfs, kernel image and dtbs dir gain a suffix with the kernel version, however if deviceinfo_dtb is unset (& dtbloader is installed - TBD: check this) then this would break dtb loading, so the latest kernels dtbs go in /boot/dtbs without a suffix.

!!! This is not ready for review. It will require much additional planning (probably an RFC). I'm just opening this so I don't lose my work

Edited by Caleb Connolly

Merge request reports

Loading