Skip to content

configure bootloaders for kernel cpu microcode loading

Administrator requested to merge craftyguy/ucode into master

The Linux kernel supports live patching CPU microcode on boot, something we should definitely support. This patch adds support to grub and sd-boot / bootloader spec config.

A new function is added to list out ucode in a directory (currently just the output dir, which is almost always /boot). It's very basic at the moment, it makes some pretty big assumptions about the name of the ucode patch file (i.e. currently expects it to match *ucode.img) This if fine for the ucode fw filenames that Alpine Linux / pmOS support. These things can/should be improved later if we need to support more situations.

For context/background, see: https://gitlab.com/postmarketOS/pmaports/-/issues/2370

Earlier versions of this patch tried to preserve writing the whole configs for each bootloader in one call to cat, e.g. by generating the list of lines to add ucode files, but it was a bit unruly (extraneous newlines and formatting was inconsistent)

cc @Minecrell

Merge request reports

Loading