]> git.proxmox.com Git - pve-kernel-meta.git/blobdiff - efiboot/zz-pve-efiboot
efiboot: be less verbose if UUID file does not exist
[pve-kernel-meta.git] / efiboot / zz-pve-efiboot
index 8d5d62593f3067769c1592a7e2c8bcbab6cd7b75..5e4d6dc50d3b18f633dea25c63e3493604787e52 100755 (executable)
@@ -5,9 +5,6 @@ set -e
 # /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"
 
@@ -35,13 +32,6 @@ trap cleanup EXIT INT TERM QUIT
 
 BOOT_KVERS="$(boot_kernel_list "$@")"
 
-if [ -f /etc/kernel/cmdline ]; then
-       CMDLINE="$(cat /etc/kernel/cmdline)"
-else
-       warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline"
-       CMDLINE="$(cat /proc/cmdline)"
-fi
-
 potential_esps(){
        lsblk --list -o PATH,UUID,FSTYPE,PARTTYPE,MOUNTPOINT |
        awk '$3 == "vfat" && $4 == "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" && $5 == "" {print $1,$2}'
@@ -49,12 +39,16 @@ potential_esps(){
 
 update_esps() {
        if [ ! -f "${ESP_LIST}" ]; then
-           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}"
-           exit 1
+           warn "No ${ESP_LIST} found, skipping ESP sync."
+           exit 0
        fi
+       if [ -f /etc/kernel/cmdline ]; then
+               CMDLINE="$(cat /etc/kernel/cmdline)"
+       else
+               warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline"
+               CMDLINE="$(cat /proc/cmdline)"
+       fi
+
        cat "${ESP_LIST}" | while IFS= read -r uuid; do
                if ! (echo "${uuid}" | grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'); then
                        warn "WARN: ${uuid} read from ${ESP_LIST} does not look like a VFAT-UUID - skipping"
@@ -71,12 +65,12 @@ update_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