Fix sgdisk partition table parsing

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-29 19:50:55 +00:00
parent f74390d632
commit f5dceb8aee

View File

@@ -87,7 +87,7 @@ dd if=/output/sparkos.img of=/tmp/esp.img bs=512 skip=2048 count=409600 2>/dev/n
# Calculate exact size for root partition
ROOT_START=411648
ROOT_END=$(sgdisk -p /output/sparkos.img | grep "^ 2" | awk '{print $3}')
ROOT_END=$(sgdisk -p /output/sparkos.img 2>/dev/null | grep "^ 2" | awk '{print $3}')
ROOT_SIZE=$((ROOT_END - ROOT_START + 1))
echo "Root partition: start=$ROOT_START, end=$ROOT_END, size=$ROOT_SIZE sectors"