[pve-devel] [PATCH kernel-meta] fix #2297: trap exit to always umount ESP in pve-efiboot-tool init

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 22 09:41:17 CEST 2019


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 bin/pve-efiboot-tool | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/pve-efiboot-tool b/bin/pve-efiboot-tool
index a2ff4e1..95ba0d9 100755
--- a/bin/pve-efiboot-tool
+++ b/bin/pve-efiboot-tool
@@ -143,6 +143,8 @@ init() {
 
 	esp_mp="/var/tmp/espmounts/$UUID"
 
+	trap "{ mountpoint -q $esp_mp && umount -Rf $esp_mp; }" EXIT
+
 	mkdir -p "$esp_mp"
 	echo "Mounting '$part' on '$esp_mp'."
 	mount -t vfat "$part" "$esp_mp"
-- 
2.20.1





More information about the pve-devel mailing list