Control: tags -1 patch

verified that the attached patch makes the postinst handle this
situation gracefully
From 62a2a00f3e32614b4d3251150149a66ad8e2d2f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <[email protected]>
Date: Thu, 31 Jul 2025 09:39:33 +0200
Subject: [PATCH] systemd-boot: fix postinst to handle missing ESP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

make the query for the ESP path via bootctl handle a missing ESP
gracefully, since bootctl will always exit with 1 and the postinst is
executed under `set -e`.

Signed-off-by: Fabian Grünbichler <[email protected]>
---
 debian/systemd-boot.postinst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/systemd-boot.postinst b/debian/systemd-boot.postinst
index 110e293..109b92e 100644
--- a/debian/systemd-boot.postinst
+++ b/debian/systemd-boot.postinst
@@ -34,7 +34,7 @@ remove_shim() {
     vendor="${ID:-debian}"
     vendor_upper="$(echo "$vendor" | cut -c1 | tr '[:lower:]' '[:upper:]')$(echo "$vendor" | cut -c2-)"
 
-    esp_path="$(bootctl --quiet --print-esp-path 2>/dev/null)"
+    esp_path="$(bootctl --quiet --print-esp-path 2>/dev/null || true)"
     if [ -z "$esp_path" ]; then
         return
     fi
@@ -99,7 +99,7 @@ install_shim() {
         return
     fi
 
-    esp_path="$(bootctl --quiet --print-esp-path 2>/dev/null)"
+    esp_path="$(bootctl --quiet --print-esp-path 2>/dev/null || true)"
     if [ -z "$esp_path" ]; then
         return
     fi
-- 
2.39.5

Reply via email to