From f5ef4a67dfd4b3570c7c606cd38d0fe62d8ac9b7 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 8 Jul 2021 10:04:58 +0200 Subject: [PATCH] grub wrapper: skip if using boot-tool but also booted via EFI From Fabians feedback: > this could have another guard for whether the system is even booted > with grub as if the system was booted using EFI, re-initing all > ESPs is just busy-work So skip if proxmox-boot-tool and booted with EFI, as then GRUB is out of the picture anyway. Signed-off-by: Thomas Lamprecht --- bin/grub-install-wrapper | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/grub-install-wrapper b/bin/grub-install-wrapper index 2bcd93d..9facd04 100755 --- a/bin/grub-install-wrapper +++ b/bin/grub-install-wrapper @@ -21,6 +21,10 @@ init_boot_disks() { if proxmox-boot-tool status --quiet; then # detect when being called by dpkg (e.g. grub-pc.postinst if [ -n "$DPKG_RUNNING_VERSION" ] && echo "$DPKG_MAINTSCRIPT_PACKAGE" | grep -sq "^grub-"; then + if [ -d /sys/firmware/efi ]; then + echo "Promxox's boot-tool is used and booted via EFI, skipping re-sync of GRUB" + exit 0 + fi MARKER_FILE="/tmp/proxmox-boot-tool.dpkg.marker" if [ ! -e "$MARKER_FILE" ]; then warn "This system is booted via proxmox-boot-tool, running proxmox-boot-tool init for all configured bootdisks" @@ -28,7 +32,7 @@ if proxmox-boot-tool status --quiet; then touch "$MARKER_FILE" exit 0 else - echo "Proxmox boot-tool marker file found, ignoring grub install call." + echo "Proxmox's boot-tool marker file found, ignoring grub install call." exit 0 fi fi