Merge pull request #2661 from deitch/raw-bios-calc

Fix KB calculation for raw images
This commit is contained in:
Avi Deitcher 2017-10-31 12:11:51 +02:00 committed by GitHub
commit 9f015c1b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -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 ))

View File

@ -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 ))