summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_local.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into openslxopenslxSimon Rettberg2024-04-121-132/+162
|\
| * [efi] Add error table entry for local filesystem EFI_NOT_FOUND errorMichael Brown2024-03-291-1/+18
| | | | | | | | | | | | | | | | | | Add an abbreviated "Not found" error message for an EFI_NOT_FOUND error encountered when attempting to open a file on a local filesystem, so that any automatic attempt to download a non-existent autoexec.ipxe script produces only a minimal error message. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Report local file errors during download, rather than on openingMichael Brown2024-03-291-124/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iPXE is designed around fully asynchronous I/O, including asynchronous connection opening. Almost all errors are therefore necessarily reported as occurring during an in-progress download, rather than occurring at the time that the URI is opened. Local file access is currently an exception to this: errors such as nonexistent files will be encountered while opening the URI. This results in mildly unexpected error messages of the form "Could not start download", rather than the usual pattern of showing the URI, the initial progress dots, and then the error message. Fix this inconsistency by deferring the local filesystem access until the local file download process is running. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* | Merge branch 'master' into openslxSimon Rettberg2023-04-041-10/+10
|\|
| * [efi] Expose efi_path_next() utility functionMichael Brown2022-12-221-10/+10
| | | | | | | | | | | | | | Provide a single central implementation of the logic for stepping through elements of an EFI device path. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Allow passing a NULL device path to path utility functionsMichael Brown2022-12-221-1/+1
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* | [efi] local: Allow loading from any volume by using file://*/...Simon Rettberg2021-10-051-7/+82
|/
* [efi] Split device path functions out to efi_path.cMichael Brown2020-10-161-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Defer local download process until file has been openedMichael Brown2020-10-131-2/+5
| | | | | | | | | | | | | | | When iPXE is downloading a file from an EFI_FILE_PROTOCOL instance backed by an EFI_BLOCK_IO_PROTOCOL instance provided by the same iPXE binary (e.g. via a hooked SAN device), then it is possible for step() to be invoked as a result of the calls into the EFI_BLOCK_IO_PROTOCOL methods. This can potentially result in efi_local_step() being run prematurely, before the file has been opened and before the parent interface has been attached. Fix by deferring starting the download process until immediately prior to returning from efi_local_open(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use device path to locate filesystem from which we were loadedMichael Brown2020-08-031-2/+13
| | | | | | | | | | | | | | | | | | | The file:/ URI syntax may be used to refer to local files on the filesystem from which the iPXE binary was loaded. This is currently implemented by directly using the DeviceHandle recorded in our EFI_LOADED_IMAGE_PROTOCOL. This mechanism will fail when a USB-enabled build of iPXE is loaded from USB storage and subsequently installs its own USB host controller drivers, since doing so will disconnect and reconnect the existing USB storage drivers and thereby invalidate the original storage device handle. Fix by recording the device path for the loaded image's DeviceHandle at initialisation time and later using the recorded device path to locate the appropriate device handle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide access to files stored on EFI filesystemsMichael Brown2016-03-141-0/+573
Provide access to local files via the "file://" URI scheme. There are three syntaxes: - An opaque URI with a relative path (e.g. "file:script.ipxe"). This will be interpreted as a path relative to the iPXE binary. - A hierarchical URI with a non-network absolute path (e.g. "file:/boot/script.ipxe"). This will be interpreted as a path relative to the root of the filesystem from which the iPXE binary was loaded. - A hierarchical URI with a network path in which the authority is a volume label (e.g. "file://bootdisk/script.ipxe"). This will be interpreted as a path relative to the root of the filesystem with the specified volume label. Note that the potentially desirable shell mappings (e.g. "fs0:" and "blk0:") are concepts internal to the UEFI shell binary, and do not seem to be exposed in any way to external executables. The old EFI_SHELL_PROTOCOL (which did provide access to these mappings) is no longer installed by current versions of the UEFI shell. Signed-off-by: Michael Brown <mcb30@ipxe.org>