From 404fc73c50c9b5c45573c067047a1464d7551f71 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Sat, 9 Oct 2021 22:50:51 +0530 Subject: [PATCH] Handle disk sector size --- crates/disks/src/config/disks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/disks/src/config/disks.rs b/crates/disks/src/config/disks.rs index 8a7f3f04..847a96f5 100644 --- a/crates/disks/src/config/disks.rs +++ b/crates/disks/src/config/disks.rs @@ -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",