KERNEL_HOOKSCRIPTS = pve-auto-removal zz-pve-efiboot
+INITRAMFS_HOOKSCRIPTS = pve-efiboot-sync
SHARE_FILES = functions
POSTINSTHOOKDIR = ${DESTDIR}/etc/kernel/postinst.d
POSTRMHOOKDIR = ${DESTDIR}/etc/kernel/postrm.d
+POSTINITRAMFSHOOKDIR = ${DESTDIR}/etc/initramfs/post-update.d
SHARE_SCRIPTDIR = ${DESTDIR}/usr/share/pve-kernel-helper/scripts
.PHONY: all
install -m 0755 ${KERNEL_HOOKSCRIPTS} ${POSTINSTHOOKDIR}
install -d ${POSTRMHOOKDIR}
install -m 0755 ${KERNEL_HOOKSCRIPTS} ${POSTRMHOOKDIR}
+ install -d ${POSTINITRAMFSHOOKDIR}
+ install -m 0755 ${INITRAMFS_HOOKSCRIPTS} ${POSTINITRAMFSHOOKDIR}
install -d ${SHARE_SCRIPTDIR}
install -m 0755 ${SHARE_FILES} ${SHARE_SCRIPTDIR}
--- /dev/null
+#! /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