Skip to content

A proof of concept concerning the automatic update of FreeBSD loaders

License

Notifications You must be signed in to change notification settings

Emrion/uploaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

uploaders

loaders-update is a tool designed to keep the FreeBSD bootcodes and loaders up-to-date.

Usage and modes

loaders-update mode [-m efi_mount_dir] [-s loaders_source_dir]

mode can be one of:

  • show-me – show but do not run commands (change nothing)
  • shoot-me – run interactively (with the option of changing nothing)

It has the following options:

  • option -m to specify the mount point of the ESP
    • default: /mnt
  • option -s to specify the path to loader-related files
    • default: /boot

Use cases and capabilities

  • AMD64 only (because I don't have other hardware for testing)
  • GUID Partition Table (GPT) only
  • BIOS boot
  • UEFI boot
  • check all disks
  • mount the ESP, if not already mounted by fstab(5)
  • if loader-related files are present in efi/, list the files
  • attempt to identify whether a loader-related file is FreeBSD-specific
    • if not specific, ignore the file
  • if the FreeBSD loader on an ESP has a nonstandard filename (maybe changed by a system administrator), preserve the name
  • for a freebsd-boot partition, compare its bootcode with the root file system
    • if not coherent, don't change the content of this freebsd-boot partition
  • if a detected loader is already up-to-date, neither suggest nor attempt an update

Out of scope

  • ESPs that have insufficient space
    • some installations that originated with FreeBSD 12, or earlier, may have this limitation
  • ESPs with no file system
  • disks with two or more ESPs, disks with two or more freebsd-boot partitions
    • if more than one exists on any single disk, the script will work with the first one alone