change align size

This commit is contained in:
2025-04-28 13:28:07 -07:00
parent f34889a405
commit a8f91e1c53
+2 -4
View File
@@ -10,15 +10,13 @@ rm -rf "${ROOTFS_DIR}"
mkdir -p "${ROOTFS_DIR}"
BOOT_SIZE="$((512 * 1024 * 1024))"
RECOVERY_SIZE="$((256 * 1024 * 1024))"
ROOT_SIZE=$(du -x --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --exclude boot/firmware --block-size=1 | cut -f 1)
# All partition sizes and starts will be aligned to this size
ALIGN="$((4 * 1024 * 1024))"
ALIGN="$((8 * 1024 * 1024))"
ROOT_MARGIN="$(echo "($ROOT_SIZE * 0.2 + 400 * 1024 * 1024) / 1" | bc)"
# Recovery partition fixed size: 256MB
RECOVERY_SIZE="$((256 * 1024 * 1024))"
BOOT_PART_START=$((ALIGN))
BOOT_PART_SIZE=$(((BOOT_SIZE + ALIGN - 1) / ALIGN * ALIGN))
ROOT_PART_START=$((BOOT_PART_START + BOOT_PART_SIZE))