From: Fabian Grünbichler Date: Wed, 10 Jul 2019 15:05:09 +0000 (+0200) Subject: efiboot: always exit cleanly X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a8dad4e801b21b7385c0dde6229880a016d2a0dd;p=pve-kernel-meta.git efiboot: always exit cleanly otherwise the whole apt process stops. Signed-off-by: Fabian Grünbichler --- diff --git a/efiboot/zz-pve-efiboot b/efiboot/zz-pve-efiboot index 5e4d6dc..06a1926 100755 --- a/efiboot/zz-pve-efiboot +++ b/efiboot/zz-pve-efiboot @@ -20,7 +20,8 @@ cleanup() { for mount in "${MOUNTROOT}"/* ; do if echo "${mount}" | grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}' && \ mountpoint -q "${mount}"; then - umount "${mount}" + umount "${mount}" || \ + { warn "umount of ${mount} failed - failure"; exit 0; } fi done @@ -62,7 +63,8 @@ update_esps() { fi mountpoint="${MOUNTROOT}/${uuid}" - mkdir -p "${mountpoint}" + mkdir -p "${mountpoint}" || \ + { warn "creation of mountpoint ${mountpoint} failed - skipping"; continue; } mount "${path}" "${mountpoint}" || \ { warn "mount of ${path} failed - skipping"; continue; } if [ ! -f "${mountpoint}/$PMX_LOADER_CONF" ]; then @@ -79,9 +81,9 @@ update_esps() { remove_old_kernels "${mountpoint}" umount "${mountpoint}" || \ - { warn "umount of ${path} failed - failure"; exit 2; } + { warn "umount of ${path} failed - failure"; exit 0; } - rmdir "${mountpoint}" + rmdir "${mountpoint}" || true done }