mirror of
https://git.proxmox.com/git/pve-kernel-meta
synced 2025-08-09 23:54:45 +00:00
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>
This commit is contained in:
parent
7559f23996
commit
5c5008bcd6
@ -3,12 +3,33 @@ set -e
|
|||||||
|
|
||||||
. /usr/share/pve-kernel-helper/scripts/functions
|
. /usr/share/pve-kernel-helper/scripts/functions
|
||||||
|
|
||||||
|
init_boot_disks() {
|
||||||
|
if ! (echo "${curr_uuid}" | grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'); then
|
||||||
|
warn "WARN: ${curr_uuid} read from ${ESP_LIST} does not look like a VFAT-UUID - skipping"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
path="/dev/disk/by-uuid/$curr_uuid"
|
||||||
|
if [ ! -e "${path}" ]; then
|
||||||
|
warn "WARN: ${path} does not exist - clean '${ESP_LIST}'! - skipping"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
proxmox-boot-tool init "$path"
|
||||||
|
}
|
||||||
|
|
||||||
if proxmox-boot-tool status --quiet; then
|
if proxmox-boot-tool status --quiet; then
|
||||||
#detect when being called by dpkg (e.g. grub-pc.postinst
|
#detect when being called by dpkg (e.g. grub-pc.postinst
|
||||||
if [ -n "$DPKG_RUNNING_VERSION" ] && \
|
if [ -n "$DPKG_RUNNING_VERSION" ] && \
|
||||||
echo "$DPKG_MAINTSCRIPT_PACKAGE" | grep -sq "^grub-"; then
|
echo "$DPKG_MAINTSCRIPT_PACKAGE" | grep -sq "^grub-"; then
|
||||||
warn "This system is booted via proxmox-boot-tool, ignoring dpkg call to grub-install"
|
MARKER_FILE="/tmp/proxmox-boot-tool.dpkg.marker"
|
||||||
exit 0
|
if [ ! -e "$MARKER_FILE" ]; then
|
||||||
|
warn "This system is booted via proxmox-boot-tool, running proxmox-boot-tool init for all configured bootdisks"
|
||||||
|
loop_esp_list init_boot_disks
|
||||||
|
touch "$MARKER_FILE"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
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"
|
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
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user