From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <s.ivanov@proxmox.com> 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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 35057F1E5 for <pve-devel@lists.proxmox.com>; Thu, 28 Sep 2023 16:06:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1CA3C1742F for <pve-devel@lists.proxmox.com>; Thu, 28 Sep 2023 16:06:02 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for <pve-devel@lists.proxmox.com>; Thu, 28 Sep 2023 16:06:00 +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 A5B9E48E42 for <pve-devel@lists.proxmox.com>; Thu, 28 Sep 2023 16:06:00 +0200 (CEST) From: Stoiko Ivanov <s.ivanov@proxmox.com> To: pve-devel@lists.proxmox.com Date: Thu, 28 Sep 2023 16:05:33 +0200 Message-Id: <20230928140533.653796-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.088 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 installer] install: install correct grub metapackage for the current boot-mode X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> X-List-Received-Date: Thu, 28 Sep 2023 14:06:02 -0000 grub packages in debian split between: * meta-packages, which handles (among other things) the reinstalling grub to the actual device/ESP in case of a version upgrade (grub-pc, grub-efi-amd64) * bin-packages, which contain the actual boot-loaders The bin-packages can coexist on a system, but the meta-package conflict with each other (didn't check why, but I don't see a hard conflict on a quick glance) Currently our ISO installs grub-pc unconditionally (and both bin packages, since we install the legacy bootloader also on uefi-booted systems). This results in uefi-systems not getting a new grub installed automatically upon upgrade. Reported in our community-forum from users who upgraded to PVE 8.0, and still run into an issue fixed in grub for bookworm: https://forum.proxmox.com/threads/.123512/ Reproduced and analyzed by Friedrich. This patch changes the installer, to install the meta-package fitting for the boot-mode. We do not set the debconf variable install_devices, because in my tests a plain debian installed in uefi mode has this set, and a `grep -ri install_devices /var/lib/dpkg/info` yields only results with grub-pc. Reported-by: Friedrich Weber <f.weber@proxmox.com> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com> --- quickly tested by building an ISO (with the necessary modifications to ship both packages as .deb) and installing in legacy mode and uefi mode once. Proxmox/Install.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm index 1117fc4..d775ac0 100644 --- a/Proxmox/Install.pm +++ b/Proxmox/Install.pm @@ -1057,6 +1057,12 @@ _EOD chomp; my $path = $_; my ($deb) = $path =~ m/${proxmox_pkgdir}\/(.*\.deb)/; + + # the grub-pc/grub-efi-amd64 packages (w/o -bin) are the ones actually updating grub + # upon upgrade - and conflict with each other - install the fitting one only + next if ($deb =~ /grub-pc_/ && $run_env->{boot_type} ne 'bios'); + next if ($deb =~ /grub-efi-amd64_/ && $run_env->{boot_type} ne 'efi'); + update_progress($count/$pkg_count, 0.5, 0.75, "extracting $deb"); print STDERR "extracting: $deb\n"; syscmd("chroot $targetdir dpkg $dpkg_opts --force-depends --no-triggers --unpack /tmp/pkg/$deb") == 0 -- 2.39.2