]> git.ipfire.org Git - thirdparty/systemd.git/commit
boot: Improve device_path_to_str_internal() 28069/head
authorJan Janssen <medhefgo@web.de>
Sun, 18 Jun 2023 08:54:20 +0000 (10:54 +0200)
committerJan Janssen <medhefgo@web.de>
Sun, 18 Jun 2023 09:13:09 +0000 (11:13 +0200)
commit78fffdea37fc9456b76b21dc94e8cb9628986f65
treefa72a2e8546cfb39fd7ace0d53d95745c8eb7c8e
parente53e5c0ac16adf2e29d31fda73656391efc38600
boot: Improve device_path_to_str_internal()

The UEFI spec has a generic `Path` node representation that can be used
for device path nodes that are unknown. So we can use that instead of
giving up when we see a node other than FilePath.

This also simplifies the FilePath case by just using xasprintf(). The
code is really just a fallback for silly firmware that does not
implement EFI_DEVICE_PATH_TO_TEXT_PROTOCOL (looking at you, Apple).

The correctness of this was tested by round-tripping it through
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL, which yielded an identical device
compared to our input path.
src/boot/efi/device-path-util.c