mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-24 13:36:31 +00:00
It seems that Busybox shell (ash) cannot calculate the disk size properly probably due to integer overflow. Use jq to calculate the last usable LBA which seems to be able to handle large integers.
This commit is contained in:
parent
8aabf65bb7
commit
0daf748c97
@ -31,8 +31,7 @@ else
|
||||
|
||||
# For MBR, we have to calculate the last usable sector by ourselfs
|
||||
DEVICE_SIZE=$(blockdev --getsize64 "${DEVICE_ROOT}")
|
||||
SECTOR_SIZE=$(echo "${PART_TABLE}" | jq -r '.partitiontable.sectorsize')
|
||||
LAST_USABLE_LBA="$((DEVICE_SIZE / SECTOR_SIZE))"
|
||||
LAST_USABLE_LBA=$(echo "${PART_TABLE}" | jq -r "${DEVICE_SIZE} / .partitiontable.sectorsize")
|
||||
fi
|
||||
echo "[INFO] Last usable logical block ${LAST_USABLE_LBA}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user