[pve-devel] [PATCH kernel-meta 08/13] esptool: move more variables to functions

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jul 10 17:05:06 CEST 2019


which is sourced by all scripts anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 efiboot/functions      |  7 +++++++
 efiboot/zz-pve-efiboot | 11 ++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/efiboot/functions b/efiboot/functions
index 1327bb4..cb6cd62 100755
--- a/efiboot/functions
+++ b/efiboot/functions
@@ -1,6 +1,13 @@
 #! /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:
 #
diff --git a/efiboot/zz-pve-efiboot b/efiboot/zz-pve-efiboot
index 8d5d625..560856f 100755
--- a/efiboot/zz-pve-efiboot
+++ b/efiboot/zz-pve-efiboot
@@ -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"
 
@@ -49,7 +46,7 @@ potential_esps(){
 
 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}"
@@ -71,12 +68,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
 
-- 
2.20.1





More information about the pve-devel mailing list