[pve-devel] [PATCH kernel-helper v2 2/2] proxmox-boot-tool: check if correct grub metapackage is installed

Friedrich Weber f.weber at proxmox.com
Wed Oct 11 11:39:06 CEST 2023


Tested-by: Friedrich Weber <f.weber at proxmox.com>

Can confirm that with this patch,

* the warning appears after installing a new kernel on a UEFI-booted
system with root on LVM
* the warning does *not* appear after installing a new kernel on
** a UEFI-booted system with root on ZFS (using systemd-boot)
** a legacy-booted system with root on LVM or ZFS

On 09/10/2023 14:52, Stoiko Ivanov wrote:
> this part of the hook applies only to systems not using pbt for
> bootmangement.
> 
> Currently our ISO installs grub-pc unconditionally - and never the
> conflicting grub-efi-amd64. Both packages are responsible for
> running grub-install (for the appropriate disks) upon an upgrade of
> grub.
> 
> This results in grub currently not getting updated on uefi-booted
> systems (which do not use proxmox-boot-tool).
> 
> The patch causes a warning to be printed to notify the user.
> 
> Also considered putting the check+warning in d/postinst - but this way
> it will get triggered more often (upon every
> kernel-upgrade/update-initramfs, instead of only on
> proxmox-kernel-helper updates, which are less often), increasing the
> chances of being noticed.
> 
> checking for the changelog-presence was chosen, over `dpkg-query` for
> the status, for consistency with the similar patch for pve7to8 (and
> potentially a small speed-gain).
> 
> Suggested-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  src/proxmox-boot/zz-proxmox-boot | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot
> index 1adc1b1..4dfa765 100755
> --- a/src/proxmox-boot/zz-proxmox-boot
> +++ b/src/proxmox-boot/zz-proxmox-boot
> @@ -215,6 +215,23 @@ disable_systemd_boot_hook() {
>  
>  }
>  
> +check_grub_efi_package() {
> +
> +	if [ -f "${ESP_LIST}" ]; then
> +		return
> +	fi
> +
> +	if [ ! -d /sys/firmware/efi ]; then
> +		return
> +	fi
> +
> +	if [ -f /usr/share/doc/grub-efi-amd64/changelog.Debian.gz ]; then
> +		return
> +	fi
> +	warn "uefi-booted system, without grub-efi-amd64 package - /boot/efi will not be updated"
> +
> +}
> +
>  set -- $DEB_MAINT_PARAMS
>  mode="${1#\'}"
>  mode="${mode%\'}"
> @@ -228,6 +245,7 @@ case $0:$mode in
>  		BOOT_KVERS="$(boot_kernel_list "$@")"
>  		update_esps
>  		disable_systemd_boot_hook
> +		check_grub_efi_package
>  	;;
>  	 */postrm.d/*:|*/postrm.d/*:remove)
>  		reexec_in_mountns "$@"
> @@ -235,6 +253,7 @@ case $0:$mode in
>  		BOOT_KVERS="$(boot_kernel_list)"
>  		update_esps
>  		disable_systemd_boot_hook
> +		check_grub_efi_package
>  	;;
>  esac
>  





More information about the pve-devel mailing list