Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Commit

Permalink
export-image: don't round up if already a multiple of 4MB
Browse files Browse the repository at this point in the history
  • Loading branch information
XECDesign committed Mar 1, 2018
1 parent 40eae05 commit 4d689a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion export-image/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TOTAL_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/

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

truncate -s ${IMG_SIZE} ${IMG_FILE}
fdisk -H 255 -S 63 ${IMG_FILE} <<EOF
Expand Down

0 comments on commit 4d689a2

Please sign in to comment.