[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 12:33:41 CEST 2019


On 7/22/19 12:17 PM, Fabian Grünbichler wrote:
> shouldn't this be quoted like this
> 
> trap '{ mountpoint -q "$esp_mp" && umount -rF "$esp_mp"; }' EXIT
> 
> ? 

No, while `shellcheck` complains the behaviour of using the value
$esp_mp has when setting up the trap, instead of your proposed of
using the value it has once the code is actually trapped, is OK here.
Actually both work in this case, but I explicitly put it below the
esp_mount= definition to ensure it's OK.


> not sure whether we want to just eval the whole block with the
> bootloader installation and unmount there, or add the unmount to the
> final cleanup?

Thanks for actually checking, while I did not note it (sorry) this was
just a shoot at the stars, with a "cannot-hurt" mindset ;)

I'd almost prefer the latter, it's a bit more robust and here the
esp call is just one way it can hit this for now and a general umount
on cleanup could not hurt..





More information about the pve-devel mailing list