Skip to content

Commit

Permalink
Handle disk sector size
Browse files Browse the repository at this point in the history
  • Loading branch information
vjr authored and jackpot51 committed Oct 23, 2021
1 parent 8b4b7be commit 404fc73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/disks/src/config/disks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,9 @@ impl Disks {
}

// 256 MiB should be the minimal size of the ESP partition.
const REQUIRED_SECTORS: u64 = 524_288;
const REQUIRED_ESP_SIZE: u64 = 256 * 1024 * 1024;

if boot.get_sectors() < REQUIRED_SECTORS {
if (boot.get_sectors() * boot.get_logical_block_size()) < REQUIRED_ESP_SIZE {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"the ESP partition must be at least 256 MiB in size",
Expand Down

0 comments on commit 404fc73

Please sign in to comment.