The right tool for this task is du
.
mkfs.vfat -C $BOOT_IMG \
$(( ($(stat -c %s $BOOT_IMG_DATA) / 1024 + 511) / 1024 ))
That command will create the file $BOOT_IMG
, which will have enough size to keep the contents of $BOOT_IMG_DATA
.
The right tool for this task is du
.
mkfs.vfat -C $BOOT_IMG \
$(( ($(stat -c %s $BOOT_IMG_DATA) / 1024 + 511) / 1024 ))
That command will create the file $BOOT_IMG
, which will have enough size to keep the contents of $BOOT_IMG_DATA
.