Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Aug 2022 14:10:15 +0300
From:      Toomas Soome <tsoome@me.com>
To:        Nuno Teixeira <eduardo@freebsd.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: 24.3. Updating Bootcode
Message-ID:  <62B26DE1-0E26-40BA-8647-E591E9ACEB7A@me.com>
In-Reply-To: <CAFDf7UJv9QCuD27XDs2ihLiN21Rn6PeZjbJtWVOAAfHb8HHnHw@mail.gmail.com>
References:  <CAFDf7UJv9QCuD27XDs2ihLiN21Rn6PeZjbJtWVOAAfHb8HHnHw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 16. Aug 2022, at 12:49, Nuno Teixeira <eduardo@freebsd.org> wrote:
>=20
> Hello all,
>=20
> With so much discussion about updating boot, I feel confused about the =
correct procedure of doing it.
>=20
> Like being said there are a "24.3. Updating Bootcode" in Handbook =
(WIP) that points to some important manuals.
>=20
> There are 3 places where boot loader are:
>=20
>  ESP (EFI System Partition):
> 1 - (/boot/efi)/efi/boot/bootXXX.efi (default location)
> 2 - (/boot/efi)/efi/freebsd/loader.efi (FreeBSD reserved area)
> Operating System:
> 3 - /boot/loader.efi
>=20
> For what I've read we should:
>  - backup: `cp /boot/efi/efi/boot/bootXXX.efi =
/boot/efi/efi/boot/bootXXX.efi.bkp`
>  - update: `cp /boot/loader.efi /boot/efi/efi/boot/bootXXX.efi`
>=20
> In this example we have a /boot/efi mount by the system, "/dev/XXXpN =
on /boot/efi (msdosfs, local)".
>=20
> What about (/boot/efi)/efi/freebsd/loader.efi (reserved area)? Is =
necessary to backup and update it too?
>=20

Hi!

I guess we need to expain a bit. EFI System Partition (ESP from now on, =
<ESP> for mountpoint), can store both EFI boot programs and EFI =
applications (diagnostics, firmware update etc). This is the reason, the =
ESP size is not specified in UEFI specification.

EFI Boot program may be stored on default path =
<ESP>/efi/boot/bootx64.efi (amd64), <ESP>/efi/boot/bootia32.efi (i386 =
32-bit), <ESP>/efi/boot/bootaarch64.efi for AARCH64 etc. It is default =
for case there is no UEFI Boot Manager set up for this media (like =
installation media on usb stick or cdrom, but also most systems support =
it with hdd).

Default path obviously does not cope with multi boot setups.

For better OS support, the UEFI specification (UEFI 2.8A Feb 14, page =
499) is suggesting to use structure like:

<ESP>/efi/<OS>/=E2=80=A6

And to use this suggestion, it means the UEFI Boot Manager needs to be =
configured (see efibootmgr(8)).

Therefore, once you have set up OS specific setup, there is no use for =
default (<ESP>/efi/boot/=E2=80=A6) and you need to update one or =
another, but not both.

hope this helps,
toomas




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?62B26DE1-0E26-40BA-8647-E591E9ACEB7A>