Commit Graph

6 Commits

Author SHA1 Message Date
Warner Losh
09ee5d8ab6 Create a function to translate UEFI paths to unix paths
efivar_device_path_to_unix_path translates from UEFI to Unix
efivar_unix_path_to_device_path translates from Unix to UEFI

At present, only HD() device types are supported (both GPT and
MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
because there's no way in the UEFI standard to specify a ZFS datastore.
Network devices aren't supported either.

Three forms of Unix path are accepted: /path/to/file (for a mounted
filesystem), //path/to/file (uses the EFI partition on the same disk
as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
produced (the first and last).

Sponsored by: Netflix
2017-12-02 07:29:19 +00:00
Warner Losh
ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00
Ryan Libby
92ac7e80da libefivar: -fno-strict-aliasing
Avoid dealing with some code that uses type-punned pointers.

See D12210 and D12211 for more background.

Reviewed by:	imp
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12219
2017-09-04 18:59:44 +00:00
Warner Losh
7270962aa5 Bring in EDK2 routines for printing and parsing device paths.
This commit implements the (mostly?) Linux compatible
efidp_format_device_path and efidp_parse_device_path APIs. These are
the only APIs exposed through this library. However, they are built on
code from Tianocore's EDK2 MdePkg. They are brought in as new files
here for reasons described in FreeBSD-update.

Symbol versioning will be introduced to control what's exported from
the EDK2 code.

Some structural changes may be necessary when we move to sharing with
sys/boot/efi.

Sponsored by: Netflix
2017-03-09 00:31:31 +00:00
Warner Losh
bea9d78b2d Share UCS2/UTF8 routines between boot loader and userland.
Move the UCS2 to UTF8 routines over into sys/boot/efi and have
libefivar grab them from there.

Sponsored by: Netflix
2017-03-09 00:24:01 +00:00
Warner Losh
d49a5ddd04 Create libefivar library. This library aims to provide
the same API as the GPL'd version of this library. It implements the common
Linux API for programatically manipulating UEFI environment varibales using
the UEFI Runtime Services the kernel provides. It replaces the old efi
library since it is programmed to a different interface, but retails the
CHAR16 to UTF-8 and vice versa conversion routines. The new name is to match
Linux program's expectations.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:30:41 +00:00