1.\" 2.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3.\" 4.\" Copyright (c) 2019 Netflix, Inc 5.\" Copyright (c) 2022 Mateusz Piotrowski <0mp@FreeBSD.org> 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" $FreeBSD$ 29.\" 30.Dd March 18, 2022 31.Dt LOADER.EFI 8 32.Os 33.Sh NAME 34.Nm loader.efi 35.Nd UEFI kernel loader 36.Sh DESCRIPTION 37On UEFI systems, 38.Nm 39loads the kernel. 40.Pp 41.Xr boot1.efi 8 42is used to load 43.Nm 44when it is placed within the system. 45.Sh FILES 46.Bl -tag -width "/boot/loader.efi" 47.It Pa /boot/loader.efi 48The location of the UEFI kernel loader within the system. 49.El 50.Ss EFI System Partition 51.Nm 52is installed on ESP (EFI System Partition) in one of the following locations: 53.Bl -tag -width "efi/freebsd/loader.efi" 54.It Pa efi/boot/bootXXX.efi 55The default location for any EFI loader 56.Po see 57.Xr uefi 8 58for values to replace 59.Ql XXX 60with 61.Pc . 62.It Pa efi/freebsd/loader.efi 63The location reserved specifically for the 64.Fx 65EFI loader. 66.El 67.Pp 68The default location for the ESP mount point is documented in 69.Xr hier 7 . 70.Sh EXAMPLES 71.Ss Updating loader.efi on ESP 72The following examples shows how to install a new 73.Nm 74on ESP. 75.Pp 76First, find the partition of type 77.Dq efi : 78.Bd -literal -offset indent 79# gpart list | grep -Ew '(Name|efi)' 801. Name: nvd0p1 81 type: efi 822. Name: nvd0p2 833. Name: nvd0p3 844. Name: nvd0p4 851. Name: nvd0 86.Ed 87.Pp 88The name of ESP on this system is 89.Pa nvd0p1 . 90.Pp 91Second, let's mount ESP, copy 92.Nm 93to the special location reserved for 94.Fx 95EFI loaders, and unmount once finished: 96.Bd -literal -offset indent 97# mount_msdosfs /dev/nvd0p1 /boot/efi 98# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi 99# umount /boot/efi 100.Sh SEE ALSO 101.Xr uefi 8 102