[pve-devel] [PATCH kernel-meta 02/10] efiboot: add loop_esp_list helper

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jul 12 15:16:43 CEST 2019


that calls the passed-in function+args for each UUID

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 efiboot/functions | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/efiboot/functions b/efiboot/functions
index 293d4c0..b926170 100755
--- a/efiboot/functions
+++ b/efiboot/functions
@@ -76,3 +76,16 @@ reexec_in_mountns() {
 		exit 0
 	fi
 }
+
+loop_esp_list() {
+	if [ ! -e ${ESP_LIST} ]; then
+		return 2
+	fi
+
+	cat "${ESP_LIST}" | while IFS= read -r curr_uuid; do
+		if [ -z "$curr_uuid" ]; then
+			continue
+		fi
+		"$@"
+	done
+}
-- 
2.20.1





More information about the pve-devel mailing list