diff --git a/src/os/uefi/mod.rs b/src/os/uefi/mod.rs index f9348e0220b4979c9354fa75b636d9153d1486bb..93ea04ae264c4e069072c653be24dbe3b11a5935 100644 --- a/src/os/uefi/mod.rs +++ b/src/os/uefi/mod.rs @@ -92,18 +92,30 @@ impl Os< fn filesystem(&self, password_opt: Option<&[u8]>) -> syscall::Result<redoxfs::FileSystem<DiskEfi>> { for block_io in DiskEfi::all().into_iter() { - if !block_io.0.Media.LogicalPartition { - continue; - } - - match redoxfs::FileSystem::open(block_io, password_opt, Some(0), false) { - Ok(ok) => return Ok(ok), - Err(err) => match err.errno { - // Ignore header not found error - syscall::ENOENT => (), - // Return any other errors - _ => { - return Err(err) + if block_io.0.Media.LogicalPartition { + match redoxfs::FileSystem::open(block_io, password_opt, Some(0), false) { + Ok(ok) => return Ok(ok), + Err(err) => match err.errno { + // Ignore header not found error + syscall::ENOENT => (), + // Return any other errors + _ => { + return Err(err) + } + } + } + } else { + //TODO: get block from partition table + let block = crate::MIBI as u64 / redoxfs::BLOCK_SIZE; + match redoxfs::FileSystem::open(block_io, password_opt, Some(block), false) { + Ok(ok) => return Ok(ok), + Err(err) => match err.errno { + // Ignore header not found error + syscall::ENOENT => (), + // Return any other errors + _ => { + return Err(err) + } } } }