mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
Fix KB calculation for raw images
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
parent
5fc38c0b40
commit
097757580d
@ -52,8 +52,7 @@ ESP_FILE_SIZE=$(( $KERNEL_FILE_SIZE + $INITRD_FILE_SIZE + $ESP_HEADROOM ))
|
||||
# we will round up to the nearest multiple of 2048 blocks
|
||||
# since each block is 512 bytes, we want the size to be a multiple of
|
||||
# 2048 blocks * 512 bytes = 1048576 bytes = 1024KB
|
||||
ESP_FILE_SIZE_KB=$(( ( ($ESP_FILE_SIZE+1024) / 1024 ) / 1024 * 1024 ))
|
||||
ESP_FILE_SIZE_MB=$(( $ESP_FILE_SIZE_KB / 1024 ))
|
||||
ESP_FILE_SIZE_KB=$(( ( ( ($ESP_FILE_SIZE+1024-1) / 1024 ) + 1024-1) / 1024 * 1024 ))
|
||||
# and for sectors
|
||||
ESP_FILE_SIZE_SECTORS=$(( $ESP_FILE_SIZE_KB * 2 ))
|
||||
|
||||
|
@ -76,7 +76,7 @@ ESP_FILE_SIZE=$(( $KERNEL_FILE_SIZE + $INITRD_FILE_SIZE + $EFI_FILE_SIZE + $ESP_
|
||||
# we will round up to the nearest multiple of 2048 blocks
|
||||
# since each block is 512 bytes, we want the size to be a multiple of
|
||||
# 2048 blocks * 512 bytes = 1048576 bytes = 1024KB
|
||||
ESP_FILE_SIZE_KB=$(( ( ($ESP_FILE_SIZE+1024) / 1024 ) / 1024 * 1024 ))
|
||||
ESP_FILE_SIZE_KB=$(( ( ( ($ESP_FILE_SIZE+1024-1) / 1024 ) + 1024-1) / 1024 * 1024 ))
|
||||
# and for sectors
|
||||
ESP_FILE_SIZE_SECTORS=$(( $ESP_FILE_SIZE_KB * 2 ))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user