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]
PartitionName = misc
BlockOffset =12
BlockOffset =24
File =.\misc.img.burn
[FILE4]
PartitionName = recovery
BlockOffset =16
BlockOffset =32
File =.\recovery.img.burn
[FILE5]
PartitionName = recovery-rootfs
BlockOffset =28
BlockOffset =56
File =.\recovery-rootfs.ubi.burn
[FILE6]
PartitionName = boot
BlockOffset =68
BlockOffset =136
File =.\zImage-dtb.burn
[FILE7]
PartitionName = system
BlockOffset =84
BlockOffset =168
File =.\system.ubi.burn
[FILE8]
PartitionName = rootfs
BlockOffset =228
BlockOffset =328
File =.\rootfs.ubi.burn
[FILE9]
PartitionName = data
BlockOffset =276
BlockOffset =424
File =.\data.ubi.burn
[FILE10]
PartitionName = usrdata
BlockOffset =324
File =.\usrdata.ubi.burn

View File

@ -1082,14 +1082,14 @@ update_programmer_ini() {
fi
# 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:]]*$//')
echo "$line" >> "$temp_file.new"
continue
fi
# 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:]]*$//')
# Check if this partition exists in our mapping
@ -1116,7 +1116,7 @@ update_programmer_ini() {
fi
# 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:]]*$//')
# Check if this partition exists in our mapping