Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Enforce a min of 256MB.
Signed-off-by: Bruce Smith <bruce_smith_it@fastmail.com>
  • Loading branch information
Smithx10 committed Jul 10, 2025
commit 905513ebb70e9845a6f82735889b0a03792ae71f
6 changes: 6 additions & 0 deletions tools/mkimage-raw-efi/make-efi
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ ESP_FILE_SIZE_KB=$(( ( ( ($ESP_DATA_SIZE + $FAT_OVERHEAD_SIZE + 1024 - 1) / 1024
# and for sectors
ESP_FILE_SIZE_SECTORS=$(( $ESP_FILE_SIZE_KB * 1024 / $SECTOR_SIZE ))

ESP_MIN_SIZE=$(( $SECTOR_SIZE * $SECTORS_PER_CLUSTER * $MIN_CLUSTERS ))
ESP_DATA_SIZE=$(( $KERNEL_FILE_SIZE + $INITRD_FILE_SIZE + $EFI_FILE_SIZE + $GRUB_FILE_SIZE ))
if [ "$ESP_DATA_SIZE" -lt "$ESP_MIN_SIZE" ]; then
ESP_DATA_SIZE="$ESP_MIN_SIZE"
fi

# create a raw disk with an EFI boot partition
# Stuff it into a FAT filesystem, making it as small as possible.
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
Expand Down