]> git.proxmox.com Git - pve-kernel-meta.git/commit - bin/proxmox-boot-tool
fix #3761: proxmox-boot: add pin/unpin for kernel-version
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 11 Feb 2022 15:15:42 +0000 (16:15 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 22 Feb 2022 12:31:31 +0000 (13:31 +0100)
commit83a41a1a034c1eab62afe4e5eed27b7f9a3f90f8
tree232424e6448f25b127c382905c96ea389e387476
parent151a54703cbab18031e692bd58dbda7ab2d1c9f9
fix #3761: proxmox-boot: add pin/unpin for kernel-version

The 2 commands follow the mechanics of p-b-t kernel add/remove in
writing the desired abi-version to a config-file in /etc/kernel and
actually modifying the boot-loader configuration upon p-b-t refresh.

A dedicated new file is used instead of writing the version (with some
kind of annotation) to the manual kernel list to keep parsing the file
simple (and hopefully also cause fewer problems with manually edited
files)

For systemd-boot we write the entry into the loader.conf on the ESP(s)
instead of relying on the `bootctl set-default` mechanics (bootctl(1))
which write the entry in an EFI-var. This was preferred, because of a
few reports of unwriteable EFI-vars on some systems (e.g. DELL servers
have a setting preventing writing EFI-vars from the OS). The rationale
in `Why not simply rely on the EFI boot menu logic?` from [0] also
makes a few points in that direction.

For grub the following choices were made:
* write the pinned version (or actually the menu-path leading to it)
  to a snippet in /etc/default/grub.d instead of editing the grub.cfg
  files on the partition. Mostly to divert as little as possible from
  the grub-workflow I assume people are used to.
* the 'root-device-id' part of the menu-entries is parsed from
  /boot/grub/grug.cfg since it was stable (the same on all ESPs and in
  /boot/grub), saves us from copying the part of "find device behind
  /, mangle it if zfs/btrfs, call grub_probe a few times" part of
  grub-mkconfig - and seems a bit more robust

Tested with a BIOS and an UEFI VM with / on ZFS.

[0] https://systemd.io/BOOT_LOADER_SPECIFICATION/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
bin/proxmox-boot-tool
proxmox-boot/functions
proxmox-boot/zz-proxmox-boot