]> git.proxmox.com Git - proxmox-kernel-helper.git/commitdiff
proxmox-boot: warn on missing systemd-boot package
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 21 Jun 2023 14:32:26 +0000 (16:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 15:27:51 +0000 (17:27 +0200)
With the shipping of systemd-boot as separate package, we cannot rely
on `bootctl` being present in all systems (e.g. currently all systems
upgraded from PVE 7 will not automatically pull systemd-boot in.

This patch adds a check for existence + warning with an explanation to
the only invocation of bootctl in the boot-tool codebase

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/bin/proxmox-boot-tool

index d41f921b840a6499d0b4f48bd9b0e377b09df051..913b0f6c0e5b78a6fd8c10b95ce1300004ae5ee5 100755 (executable)
@@ -153,6 +153,12 @@ init_bootloader() {
        if [ -d /sys/firmware/efi ]; then
                echo "Installing systemd-boot.."
                mkdir -p "$esp_mp/$PMX_ESP_DIR"
+               if ! command -V bootctl >/dev/null 2>&1 ;
+               then
+                       warn "E: bootctl is not available - make sure systemd-boot is installed"
+                       exit 1
+               fi
+
                bootctl --graceful --path "$esp_mp" install
 
                echo "Configuring systemd-boot.."