[pve-devel] applied: [PATCH proxmox-ve 1/1] add efiboot and autoremoval kernel postinst hooks

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jun 28 12:34:57 CEST 2019


On 6/27/19 8:27 PM, Stoiko Ivanov wrote:
> In order to add support for booting with ZFS on Root on EFI systems this
> patch uses systemd-boot as boot loader.
> 
> The rationale for not using grub is that there have been quite a few problems
> observed with grub and ZFS, e.g. certain RAID-controllers only having a 32bit
> implementation in grub, but ZFS writing the kernelimage or initrd after 2TB
> rendering a system unbootable.
> 
> Additionally grub only supports a certain subset of zpool features, which
> either forces users to not use newer features, or to create an additional small
> boot-pool, with the reduced feature set (which seems currently the suggestion
> from ZFS-upstream [0,1]).
> 
> the kernel-hook scripts are adapted from debian's versions for:
> * marking kernels as NeverAutoRemove (/etc/kernel/postinst.d/apt-auto-removal)
> * calling update-grub (/etc/kernel/postinst.d/zz-update-grub)
> * generating systemd-boot loader entries
>   (/usr/lib/kernel/install.d/90-loaderentry.install)
> 
> the list of kernels kept installed and configured for booting with systemd-boot
> contains:
> * the currently running kernel
> * the kernel being installed
> * the 2 newest kernels (determined by package-name, i.e. ABI-version)
> * the latest kernel from each series (e.g. 4.13, 4.15, 5.0) by keeping the
>   respective meta-packages installed
> 
> the implementation diverges from systemd's boot loader specification [0] in the
> following places:
> * adding support for multiple ESPs - all bootable disks of a RAID get configured
>   with an 512M ESP - the hookscript installs the kernels to all of them
> * the ESP(s) are not kept mounted, rather they get mounted and umounted by
>   the script:
>   * Should the system crash, this should make sure that the ESPs fs does not get
>     corrupted
>   * Keeping it mounted results in a boot-error, if the ESP, which is usually
>     mounted is not available (because the disk died)
> * kernels and initrds get installed into 'EFI/proxmox/$kver' instead
>   of '$machineid/$kver'
> 
> Since copying the necessary kernels needs a logic for cleaning up space in
> the ESP, this presents an opportunity to also be more selective about which
> kernels are marked as NeverAutoRemove, instead of keeping all versions installed
> which results in full disks for our users occasionally.
> 
> [0] https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS
> [1] https://zfsonlinux.topicbox.com/groups/zfs-discuss/Tfe475cd19433f050
> [2] https://systemd.io/BOOT_LOADER_SPECIFICATION
> ---

applied, thanks!





More information about the pve-devel mailing list