From 3b5e214f5ec4e23323bdd489b999536c487fcd12 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 13 Mar 2024 18:16:30 +0000 Subject: [PATCH] export-image: format boot partition with appropriate FAT size --- export-image/prerun.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index b95fe36..d9778d1 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -55,7 +55,14 @@ if grep -q "$FEATURE" /etc/mke2fs.conf; then ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES" fi done -mkdosfs -n bootfs -F 32 -s 4 -v "$BOOT_DEV" > /dev/null + +if [ "$BOOT_SIZE" -lt 134742016 ]; then + FAT_SIZE=16 +else + FAT_SIZE=32 +fi + +mkdosfs -n bootfs -F "$FAT_SIZE" -s 4 -v "$BOOT_DEV" > /dev/null mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4