Skip to content

Simple EFI program allowing for safe OTA updates of Linux images.

License

Notifications You must be signed in to change notification settings

david-cako/linux-OTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux OTA

Simple EFI program allowing for safe OTA updates of Linux images using A/B-split booting.

EFI variable BOOTTOGGLE is made accessible in Linux through efivarfs interface, which is then set to "A" or "B" to boot from an updated image in-place, while allowing fallback for failed updates. An init script is used to set UPDATEFLAG and BOOTCOUNT to zero on successful boot.

Compiles on Linux using EDK. Couldn't get EDK working on macOS.

Boot parititon requires two startup scripts, boot_a.nsh and boot_b.nsh, which each boot separate versions of your boot image.

efi actions:

  • if UPDATEFLAG == 0:
    • boot BOOTTOGGLE
  • if UPDATEFLAG == 1:
    • if BOOTCOUNT == 0 (not yet attempted):
      • BOOTCOUNT = 1
      • boot BOOTTOGGLE
    • if BOOTCOUNT == 1 (boot from new image unsucessful):
      • BOOTTOGGLE = opposite script
      • UPDATEFLAG = 0
      • BOOTCOUNT = 0
      • boot modified BOOTTOGGLE

linux init script actions:

  • if UPDATEFLAG == 0:

    • do nothing
  • if UPDATEFLAG == 1 (boot must have been successful):

    • UPDATEFLAG = 0
    • BOOTCOUNT = 0
  • BOOTTOGGLE is set during update

About

Simple EFI program allowing for safe OTA updates of Linux images.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published