diff options
author | Daniel Golle <daniel@makrotopia.org> | 2021-11-01 14:02:41 +0000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-11-01 18:00:52 +0000 |
commit | 5a0348fdc3c01af24bc2a867ab2f71125615b1f0 (patch) | |
tree | 016590717860d02d2ac60d3bda934ac05912e5a0 /target/linux/mediatek/mt7622/base-files | |
parent | cb5953635ed66e66c25624201c3b3289212be73f (diff) | |
download | upstream-5a0348fdc3c01af24bc2a867ab2f71125615b1f0.tar.gz upstream-5a0348fdc3c01af24bc2a867ab2f71125615b1f0.tar.bz2 upstream-5a0348fdc3c01af24bc2a867ab2f71125615b1f0.zip |
mediatek: mt7622: make use of find_mmc_part
Use find_mmc_part instead of previously introduced
get_partition_by_name which requires a custom kernel patch.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/mt7622/base-files')
-rwxr-xr-x | target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 513741d667..98775c6a13 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -13,15 +13,15 @@ platform_do_upgrade() { case "$rootdev" in mmc*) blockdev --rereadpt /dev/$rootdev || return 1 - local fitpart=$(get_partition_by_name $rootdev "production") + local fitpart=$(find_mmc_part "production" $rootdev) [ "$fitpart" ] || return 1 - dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null + dd if=/dev/zero of=$fitpart bs=4096 count=1 2>/dev/null blockdev --rereadpt /dev/$rootdev - get_image "$1" | dd of=/dev/$fitpart + get_image "$1" | dd of=$fitpart blockdev --rereadpt /dev/$rootdev - local datapart=$(get_partition_by_name $rootdev "rootfs_data") + local datapart=$(find_mmc_part "rootfs_data" $rootdev) [ "$datapart" ] || return 0 - dd if=/dev/zero of=/dev/$datapart bs=4096 count=1 2>/dev/null + dd if=/dev/zero of=$datapart bs=4096 count=1 2>/dev/null echo $datapart > /tmp/sysupgrade.datapart ;; *) @@ -95,7 +95,7 @@ platform_copy_config_mmc() { [ -e "$UPGRADE_BACKUP" ] || return local datapart=$(cat /tmp/sysupgrade.datapart) [ "$datapart" ] || echo "no rootfs_data partition, cannot keep configuration." >&2 - dd if="$UPGRADE_BACKUP" of=/dev/$datapart + dd if="$UPGRADE_BACKUP" of=$datapart sync } |