From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 64B8A91B03 for ; Wed, 4 Oct 2023 14:06:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 461A2CEE3 for ; Wed, 4 Oct 2023 14:06:25 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 4 Oct 2023 14:06:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DF61048F0A for ; Wed, 4 Oct 2023 14:06:23 +0200 (CEST) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Wed, 4 Oct 2023 14:05:57 +0200 Message-Id: <20231004120558.382180-3-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004120558.382180-1-s.ivanov@proxmox.com> References: <20231004120558.382180-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.087 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH 2/2] proxmox-boot-tool: check if correct grub metapackage is installed X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2023 12:06:55 -0000 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 Signed-off-by: Stoiko Ivanov --- 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..0d08dbf 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 -- 2.39.2