pve-kernel-meta/efiboot/pve-efiboot-sync
Stefan Reiter d156f6aa14 Add efiboot refresh hook to update-initramfs
As explained in [0], we can add a hook script that will be called after
update-initramfs did its job (and thus, a new initrd has been created).

We can use this to automatically sync the ESPs using 'pve-efiboot-tool
refresh', if update-initramfs was called manually (on kernel upgrade we
already have a hook that does this).

[0]: https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-08-05 13:26:08 +02:00

12 lines
390 B
Bash

#! /bin/sh
set -e
# Only run the refresh if update-initramfs has been called manually.
# If this script is being run as part of a post-kernel-install hook,
# this variable will be set to 1 and we do nothing, since our pve-kernel
# hooks will update the ESPs all at once anyway.
if [ -z "$INITRAMFS_TOOLS_KERNEL_HOOK" ]; then
/usr/sbin/pve-efiboot-tool refresh --hook 'zz-pve-efiboot'
fi