Upgrading BIOS Boot Loader

"For systems that boot via BIOS or UEFI CSM and use the GPT partition scheme, bootstrap upgrades are optional unless a ZFS root pool is upgraded (which is discouraged). "

( https://www.freebsd.org/releases/15.1R/upgrading/ )

Can you confirm that this means I do not need to do a bootstrap upgrade?

This is my relevant system info, first the boot method:


# sysctl machdep.bootmethod
machdep.bootmethod: BIOS


And next, the partition info:


# gpart show
=> 40 3565158320 vtbd0 GPT (1.7T)
40 1024 1 freebsd-boot (512K)
1064 3556768768 2 freebsd-ufs (1.7T)
3556769832 8388528 3 freebsd-swap (4.0G)


Based on that information, I could theoretically upgrade the bootcode with the following command:


gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 vtbd0


And then doing

shutdown -r now

However, this is optional, correct?

I have been using FreeBSD for over 25 years to host my personal websites, but I have never seen something like this to do between minor version upgrades, hence my caution.

Thank you very much.
 
The biggest thing around bootloader upgrades is "Are you using ZFS for your root device"
If the answer is no, then as SirDice says, update gets bug fixes.

If ZFS then the "commandment" is "make sure you update bootloaders BEFORE doing zpool upgrade on your pools"
 
I'm not on FreeBSD since 25 years, but as long as I recall (let say 12 era), the loaders change at each FreeBSD version, whether it's minor or major; I mean in /boot.

Often pmbr stays the same, that said, but all the others evolve.

The main change here is that the update of the loaders is far well documented than before.

The command you show is correct. And yes, it's optional in your case, but I also recommend to update at each new version.
 
Thank you all for your help!

Hypothetically, is there any way for me to look at the new changes, like diff in some form or fashion, just for my own learning?

I realize they are probably binary, but the bootloader info usually isn't super huge, so maybe I can learn something from the differences anyway, even if binary.

I just don't know how to do the equivalent of "diff" to compare the proposed new data to the old data.

Is there a command I can run to access and compare the contents of what is old and what is going to be new?

Even more amazing, would be if there is some writeup explaining the difference in the existing FreeBSD 15.0 bootloader data and the upcoming FreeBSD 15.1 bootloader data, for my situation with BIOS and GPT.

Thank you again!
 
Hypothetically, is there any way for me to look at the new changes, like diff in some form or fashion, just for my own learning?
I realize they are probably binary, but the bootloader info usually isn't super huge, so maybe I can learn something from the differences anyway, even if binary.
I just don't know how to do the equivalent of "diff" to compare the proposed new data to the old data.
Is there a command I can run to access and compare the contents of what is old and what is going to be new?
Even more amazing, would be if there is some writeup explaining the difference in the existing FreeBSD 15.0 bootloader data and the upcoming FreeBSD 15.1 bootloader data, for my situation with BIOS and GPT.
I'll give some explanation, since I was involved in creating the release notes and the updating instructions for 15.1.

We decided to include the information about the bootloader because this kind of guidance had not been included in the release documentation since 14.0. We tried to cover most common setups, although there are even more real‑world installation scenarios.

The bootloader, like any other piece of software, gets new features and bug fixes, so upgrading it is advisable.

There is also a "Bootloader changes" section in the release notes. Judging by your interest in what changed in the bootloader, I'll try to add more information about what actually changed in future releases. However, the main rule for release notes is that they should tell the user what they need to know before moving to a new version – a kind of heads‑up on what to expect – rather than listing every single change. Otherwise it would be a CHANGELOG, not release notes.
 
Is there a way to upgrade the boot loader on an arm64 device (Raspberry Pi 3 Model B)?

Code:
% uname -a
FreeBSD raspberry 15.1-RELEASE-p1 FreeBSD 15.1-RELEASE-p1 releng/15.1-n283582-0f691888dc56 GENERIC arm64
% sysctl machdep.bootmethod
sysctl: unknown oid 'machdep.bootmethod'
 
The 1.4.0 version of loaders-update should do it. On arm64, it's only EFI booting. So, OID "...bootmethod" has no meaning. Just use it in show-me mode to see what it says.
 
Is there a way to upgrade the boot loader on an arm64 device (Raspberry Pi 3 Model B)?

Code:
% uname -a
FreeBSD raspberry 15.1-RELEASE-p1 FreeBSD 15.1-RELEASE-p1 releng/15.1-n283582-0f691888dc56 GENERIC arm64
% sysctl machdep.bootmethod
sysctl: unknown oid 'machdep.bootmethod'
Haven't tested it, but I have this in a update script:

Code:
rsync -a --no-times --checksum --checksum-choice=sha1 '/boot/loader.efi' '/boot/efi/EFI/BOOT/bootaa64.efi'
 
The 1.4.0 version of loaders-update should do it. On arm64, it's only EFI booting. So, OID "...bootmethod" has no meaning. Just use it in show-me mode to see what it says.
On this device, pkg could not find loaders-update so I could not use it here. Also, efibootmgr -v and ls -l /boot/efi/ showed no output. I'm not sure if the boot loader update would have worked.

Anyway, this device had other issues after upgrading from 15.0 to 15.1. I use it as a internal LAN dns (unbound) and dhcp (dnsmasq) server. dnsmasq crashed intermittently. I have had no trouble on this device upgrading over the years from 13.0 to 15.0. So after giving up on troubleshooting, I did a fresh install with FreeBSD-15.1-RELEASE-arm64-aarch64-RPI.img.

The boot loader on this device seems okay now with the fresh install. There are a whole bunch of new issues, but since this thread is about upgrading the boot loader, I'll stop here.
 
Thanks! The gpart in the script checks for GPT. FreeBSD-15.1-RELEASE-arm64-aarch64-RPI.img isn't partitioned using GPT.

Code:
% mdo sh loaders-update.sh show-me
loaders-update v1.4.0
No disk has been detected. Exiting.

% sysctl -n kern.disks
mmcsd0
% gpart show | grep GPT | cut -wf4
% gpart show | grep GPT
% gpart show
=>      63  62333889  mmcsd0  MBR  (30G)
        63      1985          - free -  (993K)
      2048    102400       1  fat32lba  [active]  (50M)
    104448  62228480       2  freebsd  (30G)
  62332928      1024          - free -  (512K)

=>       0  62228480  mmcsd0s2  BSD  (30G)
         0       128            - free -  (64K)
       128  58435456         1  freebsd-ufs  (28G)
  58435584   3792896         2  freebsd-swap  (1.8G)
 
Yes, I chose to not enter in the MBR area, because it will add more complexity to the script. Also, MBR is clearly not turned to the future.

Since, you are on ufs, I think there is no good reason to update the loaders.
 
Back
Top