Skip to content

Commit 4d689a2

Browse files
committed
export-image: don't round up if already a multiple of 4MB
Fixes RPi-Distro#156
1 parent 40eae05 commit 4d689a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

export-image/prerun.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TOTAL_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/
1414

1515
ROUND_SIZE="$((4 * 1024 * 1024))"
1616
ROUNDED_ROOT_SECTOR=$(((2 * BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192))
17-
IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE))
17+
IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE - 1) / ROUND_SIZE * ROUND_SIZE))
1818

1919
truncate -s ${IMG_SIZE} ${IMG_FILE}
2020
fdisk -H 255 -S 63 ${IMG_FILE} <<EOF

0 commit comments

Comments
 (0)