Skip to content

Commit 40eae05

Browse files
jamesruanXECDesign
authored andcommitted
make root filesystem 4M aligned (RPi-Distro#154)
1 parent e6f7cd5 commit 40eae05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

export-image/prerun.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BOOT_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut
1313
TOTAL_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1)
1414

1515
ROUND_SIZE="$((4 * 1024 * 1024))"
16+
ROUNDED_ROOT_SECTOR=$(((2 * BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192))
1617
IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE))
1718

1819
truncate -s ${IMG_SIZE} ${IMG_FILE}
@@ -29,7 +30,7 @@ c
2930
n
3031
3132
32-
8192
33+
${ROUNDED_ROOT_SECTOR}
3334
3435
3536
p

0 commit comments

Comments
 (0)