Commit Graph

7 Commits

Author SHA1 Message Date
Stoiko Ivanov
ccfbe44f75 proxmox-boot: add reinit subcommand
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>
2022-04-27 19:06:41 +02:00
Thomas Lamprecht
f5ef4a67df 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 <t.lamprecht@proxmox.com>
2021-07-08 10:05:01 +02:00
Thomas Lamprecht
3eec58d08d grub wrapper: log on ignore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 09:52:58 +02:00
Thomas Lamprecht
ea065c7e3f grub wrapper: move to simple space indentation and minimal whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 09:27:15 +02:00
Stoiko Ivanov
5c5008bcd6 proxmox-boot: divert call to grub-install to p-b-t init
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>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
7559f23996 proxmox-boot: ignore call to grub-install from grub maintscripts
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>
2021-07-08 08:44:35 +02:00
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