#! /bin/sh
set -e
+ESP_LIST="/etc/kernel/pve-efiboot-uuids"
+ESPTYPE='c12a7328-f81f-11d2-ba4b-00a0c93ec93b'
+
+# relative to the ESP mountpoint
+PMX_ESP_DIR="EFI/proxmox"
+PMX_LOADER_CONF="loader/loader.conf"
+
# adapted from /etc/kernel/postinst.d/apt-auto-removal as present in
# debian's apt package:
#
# /usr/lib/kernel/install.d/90-loaderentry.install, see also
# https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html
-# relative to the ESP mountpoint
-ESP_LIST="/etc/kernel/pve-efiboot-uuids"
-PMX_ESP_DIR="EFI/proxmox"
MOUNTROOT="${TMPDIR:-/var/tmp}/espmounts"
update_esps() {
if [ ! -f "${ESP_LIST}" ]; then
- warn "No ${ESP_LIST} found cannot update installed kernels - exiting"
+ warn "No ${ESP_LIST} found, cannot update installed kernels - exiting"
esps="$(potential_esps)"
warn "add the UUIDs of one of the following devices to ${ESP_LIST}:"
warn "${esps}"
mkdir -p "${mountpoint}"
mount "${path}" "${mountpoint}" || \
{ warn "mount of ${path} failed - skipping"; continue; }
- if [ ! -f "${mountpoint}/loader/loader.conf" ]; then
+ if [ ! -f "${mountpoint}/$PMX_LOADER_CONF" ]; then
warn "${path} contains no loader.conf - skipping"
continue
fi
- if [ ! -d "${mountpoint}/EFI/proxmox" ]; then
- warn "${path} contains no EFI/proxmox - skipping"
+ if [ ! -d "${mountpoint}/$PMX_ESP_DIR" ]; then
+ warn "${path}/$PMX_ESP_DIR does not exist- skipping"
continue
fi