update update-partition.sh

This commit is contained in:
hyx 2026-04-14 16:26:39 +08:00
parent bd5331bea2
commit eb07df8167
2 changed files with 10 additions and 14 deletions

View File

@ -20,40 +20,36 @@ File =.\logo.img.burn
[FILE3] [FILE3]
PartitionName = misc PartitionName = misc
BlockOffset =12 BlockOffset =24
File =.\misc.img.burn File =.\misc.img.burn
[FILE4] [FILE4]
PartitionName = recovery PartitionName = recovery
BlockOffset =16 BlockOffset =32
File =.\recovery.img.burn File =.\recovery.img.burn
[FILE5] [FILE5]
PartitionName = recovery-rootfs PartitionName = recovery-rootfs
BlockOffset =28 BlockOffset =56
File =.\recovery-rootfs.ubi.burn File =.\recovery-rootfs.ubi.burn
[FILE6] [FILE6]
PartitionName = boot PartitionName = boot
BlockOffset =68 BlockOffset =136
File =.\zImage-dtb.burn File =.\zImage-dtb.burn
[FILE7] [FILE7]
PartitionName = system PartitionName = system
BlockOffset =84 BlockOffset =168
File =.\system.ubi.burn File =.\system.ubi.burn
[FILE8] [FILE8]
PartitionName = rootfs PartitionName = rootfs
BlockOffset =228 BlockOffset =328
File =.\rootfs.ubi.burn File =.\rootfs.ubi.burn
[FILE9] [FILE9]
PartitionName = data PartitionName = data
BlockOffset =276 BlockOffset =424
File =.\data.ubi.burn File =.\data.ubi.burn
[FILE10]
PartitionName = usrdata
BlockOffset =324
File =.\usrdata.ubi.burn

View File

@ -1082,14 +1082,14 @@ update_programmer_ini() {
fi fi
# Extract PartitionName # Extract PartitionName
if [[ "$line" =~ ^PartitionName[[:space:]]*=[[:space:]]*(.+)$ ]]; then if [[ "$line" =~ ^[[:space:]]*PartitionName[[:space:]]*=[[:space:]]*(.+)$ ]]; then
partition_name=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') partition_name=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
echo "$line" >> "$temp_file.new" echo "$line" >> "$temp_file.new"
continue continue
fi fi
# Update BlockOffset if we have a matching partition name and medium type is los_spi-nand # Update BlockOffset if we have a matching partition name and medium type is los_spi-nand
if [ "$MEDIUM_TYPE" = "los_spi-nand" ] && [[ "$line" =~ ^BlockOffset[[:space:]]*=[[:space:]]*(.+)$ ]] && [ -n "$partition_name" ]; then if [ "$MEDIUM_TYPE" = "los_spi-nand" ] && [[ "$line" =~ ^[[:space:]]*BlockOffset[[:space:]]*=[[:space:]]*(.+)$ ]] && [ -n "$partition_name" ]; then
local old_offset=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') local old_offset=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
# Check if this partition exists in our mapping # Check if this partition exists in our mapping
@ -1116,7 +1116,7 @@ update_programmer_ini() {
fi fi
# Update BufferOffset if we have a matching partition name and medium type is los_spi-nor # Update BufferOffset if we have a matching partition name and medium type is los_spi-nor
if [ "$MEDIUM_TYPE" = "los_spi-nor" ] && [[ "$line" =~ ^BufferOffset[[:space:]]*=[[:space:]]*(.+)$ ]] && [ -n "$partition_name" ]; then if [ "$MEDIUM_TYPE" = "los_spi-nor" ] && [[ "$line" =~ ^[[:space:]]*BufferOffset[[:space:]]*=[[:space:]]*(.+)$ ]] && [ -n "$partition_name" ]; then
local old_offset=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') local old_offset=$(echo "${BASH_REMATCH[1]}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
# Check if this partition exists in our mapping # Check if this partition exists in our mapping