Skip to content

Commit

Permalink
999-resin-boot-cleaner: Backport HUP fix for already mounted efivars …
Browse files Browse the repository at this point in the history
…directory

This back-ports commit 678232d which checks if efivarsfs has already been mounted by the hostapp-update script.

Changelog-entry: 999-resin-boot-cleaner: Backport HUP fix for already mounted efivars directory
Signed-off-by: Alexandru Costache <[email protected]>
  • Loading branch information
acostach authored and alexgg committed Mar 12, 2024
1 parent add4800 commit 609fb8b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ if [ "$DURING_UPDATE" = "1" ]; then
# re-add the EFI entry for resinOS boot from internal media as some EFI firmwares are buggy and won't detect the old entry anymore
# first remove existing resinOS entries so we won't have duplicates
printf "[INFO] Re-add EFI boot entry for starting resinOS from internal media.\n"
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
if [ -z "$(ls -A /sys/firmware/efi/efivars)" ]; then
# efivars not bind-mounted by hostapp-update script
mount -t efivarfs efivarfs /sys/firmware/efi/efivars || true
fi
duplicates=`efibootmgr | grep resinOS |sed 's/Boot*//g' | sed 's/* resinOS//g'`
for i in $duplicates; do efibootmgr -B -b $i; done
efibootmgr -c -d $device -p 1 -L "resinOS" -l "\EFI\BOOT\bootx64.efi"
Expand Down

0 comments on commit 609fb8b

Please sign in to comment.