Skip to content

Commit

Permalink
[efi] Provide access to files stored on EFI filesystems
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Mar 14, 2016
1 parent 7549681 commit 9913a40
Show file tree
Hide file tree
Showing 5 changed files with 581 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config/config_efi.c
Expand Up @@ -21,6 +21,7 @@

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );

#include <config/general.h>
#include <config/console.h>

/** @file
Expand All @@ -45,3 +46,6 @@ REQUIRE_OBJECT ( efi_fbcon );
#ifdef CONSOLE_FRAMEBUFFER
REQUIRE_OBJECT ( efi_fbcon );
#endif
#ifdef DOWNLOAD_PROTO_FILE
REQUIRE_OBJECT ( efi_local );
#endif
2 changes: 2 additions & 0 deletions src/config/defaults/efi.h
Expand Up @@ -24,6 +24,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define TIME_EFI
#define REBOOT_EFI

#define DOWNLOAD_PROTO_FILE /* Local filesystem access */

#define IMAGE_EFI /* EFI image support */
#define IMAGE_SCRIPT /* iPXE script image support */

Expand Down
1 change: 1 addition & 0 deletions src/config/general.h
Expand Up @@ -57,6 +57,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
#undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */
#undef DOWNLOAD_PROTO_NFS /* Network File System Protocol */
//#undef DOWNLOAD_PROTO_FILE /* Local filesystem access */

/*
* SAN boot protocols
Expand Down
1 change: 1 addition & 0 deletions src/include/ipxe/errfile.h
Expand Up @@ -347,6 +347,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_efi_pxe ( ERRFILE_OTHER | 0x004a0000 )
#define ERRFILE_efi_usb ( ERRFILE_OTHER | 0x004b0000 )
#define ERRFILE_efi_fbcon ( ERRFILE_OTHER | 0x004c0000 )
#define ERRFILE_efi_local ( ERRFILE_OTHER | 0x004d0000 )

/** @} */

Expand Down

0 comments on commit 9913a40

Please sign in to comment.