all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH 2/3] proxmox-boot: warn on missing systemd-boot package
Date: Wed, 21 Jun 2023 16:32:26 +0200	[thread overview]
Message-ID: <20230621143227.1510250-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20230621143227.1510250-1-s.ivanov@proxmox.com>

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>
---
 src/bin/proxmox-boot-tool | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bin/proxmox-boot-tool b/src/bin/proxmox-boot-tool
index d41f921..913b0f6 100755
--- a/src/bin/proxmox-boot-tool
+++ b/src/bin/proxmox-boot-tool
@@ -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.."
-- 
2.30.2





  parent reply	other threads:[~2023-06-21 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 14:32 [pve-devel] [PATCH 0/3] adapt to systemd-boot hooks in bookworm Stoiko Ivanov
2023-06-21 14:32 ` [pve-devel] [PATCH 1/3] boot-tool: disarm upstream systemd-boot hookscripts Stoiko Ivanov
2023-06-21 14:32 ` Stoiko Ivanov [this message]
2023-06-21 14:32 ` [pve-devel] [PATCH 3/3] d/control: add Recommends on systemd-boot Stoiko Ivanov
2023-06-21 15:37 ` [pve-devel] applied: [PATCH 0/3] adapt to systemd-boot hooks in bookworm Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621143227.1510250-3-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal