Skip to content

Commit

Permalink
efi: Consistently support filenames up to 256 characters
Browse files Browse the repository at this point in the history
Previously the path in the FileDevicePathProtocol was limited to 128
ascii characters.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
  • Loading branch information
rbradford committed Dec 19, 2023
1 parent 3b10efe commit 3c75868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/efi/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::block::SectorBuf;
#[repr(C)]
pub struct FileDevicePathProtocol {
pub device_path: DevicePathProtocol,
pub filename: [u16; 64],
pub filename: [u16; 128],
}

pub extern "efiapi" fn filesystem_open_volume(
Expand Down
6 changes: 3 additions & 3 deletions src/efi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,17 +1067,17 @@ fn file_device_path(path: &str) -> *mut r_efi::protocols::device_path::Protocol
device_path: DevicePathProtocol {
r#type: r_efi::protocols::device_path::TYPE_MEDIA,
sub_type: 4, // Media Path type file
length: [132, 0],
length: [(260u16 & 0xff) as u8, (260u16 >> 8) as u8],
},
filename: [0; 64],
filename: [0; 128],
},
file::FileDevicePathProtocol {
device_path: DevicePathProtocol {
r#type: r_efi::protocols::device_path::TYPE_END,
sub_type: 0xff, // End of full path
length: [4, 0],
},
filename: [0; 64],
filename: [0; 128],
},
];

Expand Down

0 comments on commit 3c75868

Please sign in to comment.