to iterate over all configured ESPs and refresh the boot-loader
installations.
the init function was changed to not run refresh directly - to prevent
refresh from running once for each ESP
currently reinit does not imply refresh
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
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 <t.lamprecht@proxmox.com>
This way all ESPs (in case of a legacy booted system) get an
updated grub installation.
running only once between reboots (the markerfile is in /tmp) should
be enough. Sadly the environment does not provide a hint which version
grub is installed to.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
in certain cases the postinst script of grub-pc runs grub-install on
the disks it gets from debconf. Simply warn and exit with 0 if
grub-install is called by dpkg and from a grub related package
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
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>