]> git.proxmox.com Git - pve-kernel-meta.git/blob - bin/grub-install-wrapper
bump version to 7.3-8
[pve-kernel-meta.git] / bin / grub-install-wrapper
1 #! /bin/sh
2
3 set -e
4
5 . /usr/share/pve-kernel-helper/scripts/functions
6
7 if proxmox-boot-tool status --quiet; then
8 # detect when being called by dpkg (e.g. grub-pc.postinst
9 if [ -n "$DPKG_RUNNING_VERSION" ] && echo "$DPKG_MAINTSCRIPT_PACKAGE" | grep -sq "^grub-"; then
10 if [ -d /sys/firmware/efi ]; then
11 echo "Promxox's boot-tool is used and booted via EFI, skipping re-sync of GRUB"
12 exit 0
13 fi
14 MARKER_FILE="/tmp/proxmox-boot-tool.dpkg.marker"
15 if [ ! -e "$MARKER_FILE" ]; then
16 warn "This system is booted via proxmox-boot-tool, running proxmox-boot-tool init for all configured bootdisks"
17 proxmox-boot-tool reinit
18 proxmox-boot-tool refresh
19 touch "$MARKER_FILE"
20 exit 0
21 else
22 echo "Proxmox's boot-tool marker file found, ignoring grub install call."
23 exit 0
24 fi
25 fi
26 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"
27 exit 1
28 else
29 grub-install.real "$@"
30 fi