diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-05-05 12:46:54 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-05-05 13:05:28 +0100 |
commit | f93e6b712ff2beb7ea4e169a681b8144785f3e49 (patch) | |
tree | 88ac669c460764609ebd87cbe0ae2732d86dc2a0 | |
parent | 22cc65535a331f05863f3c4b48910b0d50ff5dd7 (diff) | |
download | ipxe-f93e6b712ff2beb7ea4e169a681b8144785f3e49.zip ipxe-f93e6b712ff2beb7ea4e169a681b8144785f3e49.tar.gz ipxe-f93e6b712ff2beb7ea4e169a681b8144785f3e49.tar.bz2 |
[efi] Show original filenames in debug messages
Show the original filename as used by the consumer when calling our
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL's Open() method.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/interface/efi/efi_file.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/interface/efi/efi_file.c b/src/interface/efi/efi_file.c index 2ac6e2b..fd0bcc6 100644 --- a/src/interface/efi/efi_file.c +++ b/src/interface/efi/efi_file.c @@ -291,10 +291,12 @@ static size_t efi_file_read_initrd ( struct efi_file_reader *reader ) { * Open fixed file * * @v file EFI file + * @v wname Filename * @v new New EFI file * @ret efirc EFI status code */ static EFI_STATUS efi_file_open_fixed ( struct efi_file *file, + const wchar_t *wname, EFI_FILE_PROTOCOL **new ) { /* Increment reference count */ @@ -303,7 +305,8 @@ static EFI_STATUS efi_file_open_fixed ( struct efi_file *file, /* Return opened file */ *new = &file->file; - DBGC ( file, "EFIFILE %s opened\n", efi_file_name ( file ) ); + DBGC ( file, "EFIFILE %s opened via %ls\n", + efi_file_name ( file ), wname ); return 0; } @@ -324,10 +327,12 @@ static void efi_file_image ( struct efi_file *file, struct image *image ) { * Open image-backed file * * @v image Image + * @v wname Filename * @v new New EFI file * @ret efirc EFI status code */ static EFI_STATUS efi_file_open_image ( struct image *image, + const wchar_t *wname, EFI_FILE_PROTOCOL **new ) { struct efi_file *file; @@ -343,7 +348,8 @@ static EFI_STATUS efi_file_open_image ( struct image *image, /* Return opened file */ *new = &file->file; - DBGC ( file, "EFIFILE %s opened\n", efi_file_name ( file ) ); + DBGC ( file, "EFIFILE %s opened via %ls\n", + efi_file_name ( file ), wname ); return 0; } @@ -377,7 +383,7 @@ efi_file_open ( EFI_FILE_PROTOCOL *this, EFI_FILE_PROTOCOL **new, /* Allow root directory itself to be opened */ if ( ( name[0] == '\0' ) || ( name[0] == '.' ) ) - return efi_file_open_fixed ( &efi_file_root, new ); + return efi_file_open_fixed ( &efi_file_root, wname, new ); /* Fail unless opening from the root */ if ( file != &efi_file_root ) { @@ -395,13 +401,15 @@ efi_file_open ( EFI_FILE_PROTOCOL *this, EFI_FILE_PROTOCOL **new, /* Allow registered images to be opened */ if ( ( image = efi_file_find ( name ) ) != NULL ) - return efi_file_open_image ( image, new ); + return efi_file_open_image ( image, wname, new ); /* Allow magic initrd to be opened */ - if ( strcasecmp ( name, efi_file_initrd.file.name ) == 0 ) - return efi_file_open_fixed ( &efi_file_initrd.file, new ); + if ( strcasecmp ( name, efi_file_initrd.file.name ) == 0 ) { + return efi_file_open_fixed ( &efi_file_initrd.file, wname, + new ); + } - DBGC ( file, "EFIFILE %s does not exist\n", name ); + DBGC ( file, "EFIFILE %ls does not exist\n", wname ); return EFI_NOT_FOUND; } @@ -832,7 +840,7 @@ efi_file_open_volume ( EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *filesystem __unused, EFI_FILE_PROTOCOL **file ) { DBGC ( &efi_file_root, "EFIFILE open volume\n" ); - return efi_file_open_fixed ( &efi_file_root, file ); + return efi_file_open_fixed ( &efi_file_root, L"<volume>", file ); } /** EFI simple file system protocol */ |