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 04C30B3D18 for ; Wed, 29 Nov 2023 15:17:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E11FB8BDF for ; Wed, 29 Nov 2023 15:17:34 +0100 (CET) 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, 29 Nov 2023 15:17:34 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1E96840D89 for ; Wed, 29 Nov 2023 15:17:34 +0100 (CET) From: Stoiko Ivanov To: pbs-devel@lists.proxmox.com Date: Wed, 29 Nov 2023 15:17:15 +0100 Message-Id: <20231129141715.219393-3-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231129141715.219393-1-s.ivanov@proxmox.com> References: <20231129141715.219393-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.089 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2023 14:17:35 -0000 ported over from pve-manager: 'pve7to8: check for proper grub meta-package for bootmode' `67c655b9333714f31d5115de80961a2abc4b6506` Signed-off-by: Stoiko Ivanov --- src/bin/pbs2to3.rs | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs index a9b537fd..177d3b37 100644 --- a/src/bin/pbs2to3.rs +++ b/src/bin/pbs2to3.rs @@ -191,34 +191,40 @@ impl Checker { self.output .log_info("Checking bootloader configuration...")?; - // PBS packages version check needs to be run before - if !self.upgraded { - self.output - .log_skip("not yet upgraded, no need to check the presence of systemd-boot")?; - } - - if !Path::new("/etc/kernel/proxmox-boot-uuids").is_file() { - self.output - .log_skip("proxmox-boot-tool not used for bootloader configuration")?; - return Ok(()); - } - if !Path::new("/sys/firmware/efi").is_dir() { self.output .log_skip("System booted in legacy-mode - no need for systemd-boot")?; return Ok(()); } - if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() { - self.output.log_pass("systemd-boot is installed")?; - } else { + if Path::new("/etc/kernel/proxmox-boot-uuids").is_file() { + // PBS packages version check needs to be run before + if !self.upgraded { + self.output + .log_skip("not yet upgraded, no need to check the presence of systemd-boot")?; + return Ok(()); + } + if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() { + self.output.log_pass("bootloader packages installed correctly")?; + return Ok(()); + } self.output.log_warn( "proxmox-boot-tool is used for bootloader configuration in uefi mode \ - but the separate systemd-boot package, existing in Debian Bookworm \ - is not installed.\n\ + but the separate systemd-boot package, is not installed.\n\ initializing new ESPs will not work unitl the package is installed.", )?; + return Ok(()); + } else if !Path::new("/usr/share/doc/grub-efi-amd64/changelog.Debian.gz").is_file() { + self.output.log_warn( + "System booted in uefi mode but grub-efi-amd64 meta-package not installed, \ + new grub versions will not be installed to /boot/efi! + Install grub-efi-amd64." + )?; + return Ok(()); + } else { + self.output.log_pass("bootloader packages installed correctly")?; } + Ok(()) } -- 2.39.2