diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-11-08 02:09:13 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-11-08 02:35:29 +0100 |
commit | a0a93056d5d5c52b739a2bc8fe0e2aaabb962f36 (patch) | |
tree | fc382b44ed57cb74e548ae259239a74eaafe9995 /mcp/scripts | |
parent | b1ea72ba2c441a59327cc931b95bb7ece41591d0 (diff) |
lib.sh: Cleanup previous /boot/efi contents
Some UEFI firmwares insist on scanning removable drives, even when
boot entries were deleted from UEFI boot list (board flash).
To work around this, remove contents of </boot/efi/*>, so scanning
won't identify any valid EFI binaries.
Another option would be erasing partition tables, but identifying
the underlying disk(s) is more complicated, especially when using
LVM/RAID etc.
Change-Id: I9949b99b139b1642e3bd8f04de3bd5ef74d1ecc5
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/scripts')
-rw-r--r-- | mcp/scripts/lib.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 6b7193b3f..c6d5d26ce 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -41,7 +41,8 @@ function cleanup_uefi { ssh ${SSH_OPTS} "${SSH_SALT}" "sudo salt -C 'kvm* or cmp*' cmd.run \ \"which efibootmgr > /dev/null 2>&1 && \ efibootmgr | grep -oP '(?<=Boot)[0-9]+(?=.*ubuntu)' | \ - xargs -I{} efibootmgr --delete-bootnum --bootnum {}\"" || true + xargs -I{} efibootmgr --delete-bootnum --bootnum {}; \ + rm -rf /boot/efi/*\"" || true } function cleanup_vms { |