]> git.proxmox.com Git - pmg-api.git/commitdiff
pmg7to8: check for proper grub meta-package for bootmode
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 15 Dec 2023 18:08:16 +0000 (19:08 +0100)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 15 Dec 2023 18:08:20 +0000 (19:08 +0100)
This should catch installations from our ISO on non-ZFS in uefi mode,
which won't get the updated grub efi binary installed upon upgrade,
because grub-pc is installed instead of grub-efi-amd64.

follows commit 67c655b9333714f31d5115de80961a2abc4b6506 in pve-manager

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/CLI/pmg7to8.pm

index 86ef9032b1fd371abcf4934934df33b4a9c9842a..947e9e33cae088d80e85cf6b71c9f7990eb58917 100644 (file)
@@ -454,29 +454,36 @@ sub check_time_sync {
 
 sub check_bootloader {
     log_info("Checking bootloader configuration...");
-    if (!$upgraded) {
-       log_skip("not yet upgraded, no need to check the presence of systemd-boot");
-       return;
-    }
 
-    if (! -f "/etc/kernel/proxmox-boot-uuids") {
-       log_skip("proxmox-boot-tool not used for bootloader configuration");
+    if (! -d '/sys/firmware/efi') {
+       log_skip("System booted in legacy-mode - no need for additional packages");
        return;
     }
 
-    if (! -d "/sys/firmware/efi") {
-       log_skip("System booted in legacy-mode - no need for systemd-boot");
-       return;
-    }
-
-    if ( -f "/usr/share/doc/systemd-boot/changelog.Debian.gz") {
-       log_pass("systemd-boot is installed");
-    } else {
+    if ( -f "/etc/kernel/proxmox-boot-uuids") {
+       if (!$upgraded) {
+           log_skip("not yet upgraded, no need to check the presence of systemd-boot");
+           return;
+       }
+       if ( -f "/usr/share/doc/systemd-boot/changelog.Debian.gz") {
+           log_pass("bootloader packages installed correctly");
+           return;
+       }
        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"
-           . "initializing new ESPs will not work until the package is installed"
+           . " but the separate systemd-boot package is not installed,"
+           . " initializing new ESPs will not work until the package is installed"
+       );
+       return;
+    } elsif ( ! -f "/usr/share/doc/grub-efi-amd64/changelog.Debian.gz" ) {
+       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;
+    } else {
+       log_pass("bootloader packages installed correctly");
     }
 }