pve-kernel-meta/bin/grub-install-wrapper
Stoiko Ivanov 18a8d30651 proxmox-boot: re-add include of helper-functions
this fixes ccfbe44f75

in the patch I accidentally removed the include of the helper
functions - the code uses `warn` from there

reported in our enterprise support portal and in our community-forum:
https://forum.proxmox.com/threads/.114998

reproduced with a VM:
* legacy bios
* installed PVE 6.3 (so that p-b-t was not used for legacy systems)
* then upgraded to a bullseye snapshot of 01.09.2022
* then upgraded to the last bullseye point-release
- this patch fixes the issue there.

The issue should not occur on systems using p-b-t or not using zfs
for /.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2022-09-12 15:38:51 +02:00

31 lines
1.2 KiB
Bash
Executable File

#! /bin/sh
set -e
. /usr/share/pve-kernel-helper/scripts/functions
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"
proxmox-boot-tool reinit
proxmox-boot-tool refresh
touch "$MARKER_FILE"
exit 0
else
echo "Proxmox's boot-tool marker file found, ignoring grub install call."
exit 0
fi
fi
warn "grub-install is disabled because this system is booted via proxmox-boot-tool, if you really need to run it, run /usr/sbin/grub-install.real"
exit 1
else
grub-install.real "$@"
fi