mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-18 17:01:07 +00:00
Merge pull request #2661 from deitch/raw-bios-calc
Fix KB calculation for raw images
This commit is contained in:
commit
9f015c1b61
@ -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