feat: update partition script to include data partition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
cloudwithax 2026-02-17 17:50:03 -05:00
parent 88c7b17237
commit 599b4df508
1 changed files with 17 additions and 16 deletions

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# Assemble SPL, U-Boot, U-Boot environment, boot-resources, boot and rootfs # Assemble SPL, U-Boot, U-Boot environment, boot-resources, boot, rootfs
# images into a final H700 bootable sdcard image. # and data images into a final H700 bootable sdcard image.
set -e set -e
if [[ $# -lt 7 ]] ; then if [[ $# -lt 8 ]] ; then
echo "Usage: $0 SDCARD SPL UBOOT ENV BOOT-RESOURCE BOOT ROOTFS" echo "Usage: $0 SDCARD SPL UBOOT ENV BOOT-RESOURCE BOOT ROOTFS DATA"
exit 0 exit 0
fi fi
@ -20,12 +20,13 @@ sgdisk --move-main-table=73696 -I \
--new="0:0:+$(mb "$5")" --change-name=0:boot-resource --attributes=0:=:c000000000000001 --typecode=0:0700 \ --new="0:0:+$(mb "$5")" --change-name=0:boot-resource --attributes=0:=:c000000000000001 --typecode=0:0700 \
--new="0:0:+$(mb "$6")" --change-name=0:boot --attributes=0:=:c000000000000001 --typecode=0:a002 \ --new="0:0:+$(mb "$6")" --change-name=0:boot --attributes=0:=:c000000000000001 --typecode=0:a002 \
--new="0:0:+$(mb "$7")" --change-name=0:rootfs --attributes=0:=:c000000000000001 --typecode=0:8305 \ --new="0:0:+$(mb "$7")" --change-name=0:rootfs --attributes=0:=:c000000000000001 --typecode=0:8305 \
--new="0:0:+$(mb "$8")" --change-name=0:data --attributes=0:=:c000000000000001 --typecode=0:0700 \
"$1" "$1"
part_table="$(sgdisk -p artifacts/alpine-h700.img | awk '/^ +[0-9]+ +[0-9]+ +[0-9]+/{print $2 / 2}' | xargs)" part_table="$(sgdisk -p "$1" | awk '/^ +[0-9]+ +[0-9]+ +[0-9]+/{print $2 / 2}' | xargs)"
read -r -a offsets <<<"$part_table" read -r -a offsets <<<"$part_table"
images=("$2" "$3" "$4" "$5" "$6" "$7") images=("$2" "$3" "$4" "$5" "$6" "$7" "$8")
offsets=(8 16400 "${offsets[@]}") offsets=(8 16400 "${offsets[@]}")
for i in "${!images[@]}"; do for i in "${!images[@]}"; do