Skip to content

Commit 9913a40

Browse files
committed
[efi] Provide access to files stored on EFI filesystems
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>
1 parent 7549681 commit 9913a40

File tree

5 files changed

+581
-0
lines changed

5 files changed

+581
-0
lines changed

src/config/config_efi.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
2323

24+
#include <config/general.h>
2425
#include <config/console.h>
2526

2627
/** @file
@@ -45,3 +46,6 @@ REQUIRE_OBJECT ( efi_fbcon );
4546
#ifdef CONSOLE_FRAMEBUFFER
4647
REQUIRE_OBJECT ( efi_fbcon );
4748
#endif
49+
#ifdef DOWNLOAD_PROTO_FILE
50+
REQUIRE_OBJECT ( efi_local );
51+
#endif

src/config/defaults/efi.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
2424
#define TIME_EFI
2525
#define REBOOT_EFI
2626

27+
#define DOWNLOAD_PROTO_FILE /* Local filesystem access */
28+
2729
#define IMAGE_EFI /* EFI image support */
2830
#define IMAGE_SCRIPT /* iPXE script image support */
2931

src/config/general.h

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5757
#undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
5858
#undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */
5959
#undef DOWNLOAD_PROTO_NFS /* Network File System Protocol */
60+
//#undef DOWNLOAD_PROTO_FILE /* Local filesystem access */
6061

6162
/*
6263
* SAN boot protocols

src/include/ipxe/errfile.h

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
347347
#define ERRFILE_efi_pxe ( ERRFILE_OTHER | 0x004a0000 )
348348
#define ERRFILE_efi_usb ( ERRFILE_OTHER | 0x004b0000 )
349349
#define ERRFILE_efi_fbcon ( ERRFILE_OTHER | 0x004c0000 )
350+
#define ERRFILE_efi_local ( ERRFILE_OTHER | 0x004d0000 )
350351

351352
/** @} */
352353

0 commit comments

Comments
 (0)