]> git.proxmox.com Git - pve-kernel-meta.git/commitdiff
efiboot: add loop_esp_list helper
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 12 Jul 2019 13:16:43 +0000 (15:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Jul 2019 12:28:21 +0000 (14:28 +0200)
that calls the passed-in function+args for each UUID

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
efiboot/functions

index 293d4c0f3c1183a25b7fc93ff062e72d05a77d69..b926170eed5d27575ce22d171b6d6d5d1496f76d 100755 (executable)
@@ -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
+}