pve-kernel-meta/bin/grub-install-wrapper
Stoiko Ivanov 7290506104 proxmox-boot: add grub-install wrapper
if a (legacy) system is booted with proxmox-boot-tool, running
`grub-install` without being aware of the fact can render the system
unbootable (e.g. when letting the early stage point to an incompatible
zpool instead of the ESP).

To prevent this we add a dpkg-diversion [0], which simply checks if
`proxmox-boot-tool status` indicates that proxmox-boot is used and
errors out in that case, and runs the actual grub-install else.

Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00

13 lines
300 B
Bash
Executable File

#! /bin/sh
set -e
. /usr/share/pve-kernel-helper/scripts/functions
if proxmox-boot-tool status --quiet; then
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