Skip to content

Commit 905513e

Browse files
committed
Enforce a min of 256MB.
Signed-off-by: Bruce Smith <bruce_smith_it@fastmail.com>
1 parent 2b46873 commit 905513e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/mkimage-raw-efi/make-efi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ ESP_FILE_SIZE_KB=$(( ( ( ($ESP_DATA_SIZE + $FAT_OVERHEAD_SIZE + 1024 - 1) / 1024
8888
# and for sectors
8989
ESP_FILE_SIZE_SECTORS=$(( $ESP_FILE_SIZE_KB * 1024 / $SECTOR_SIZE ))
9090

91+
ESP_MIN_SIZE=$(( $SECTOR_SIZE * $SECTORS_PER_CLUSTER * $MIN_CLUSTERS ))
92+
ESP_DATA_SIZE=$(( $KERNEL_FILE_SIZE + $INITRD_FILE_SIZE + $EFI_FILE_SIZE + $GRUB_FILE_SIZE ))
93+
if [ "$ESP_DATA_SIZE" -lt "$ESP_MIN_SIZE" ]; then
94+
ESP_DATA_SIZE="$ESP_MIN_SIZE"
95+
fi
96+
9197
# create a raw disk with an EFI boot partition
9298
# Stuff it into a FAT filesystem, making it as small as possible.
9399
mkfs.vfat -v -F $FAT_SIZE -S $SECTOR_SIZE -s $SECTORS_PER_CLUSTER -R $RESERVED_SECTORS -C $ESP_FILE $(( $ESP_FILE_SIZE_KB )) > /dev/null

0 commit comments

Comments
 (0)