mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-20 17:32:57 +00:00
mediatek: make sure MMC is not busy before commencing sysupgrade
In case of the block device still being in use, re-reading the partition table fails. In that case, abort sysupgrade to avoid corrupting the just-written image because of wrong offsets caused by failure to re-read the partition table. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
b2aca61360
commit
4ae4035e60
@ -12,6 +12,7 @@ platform_do_upgrade() {
|
|||||||
export_partdevice rootdev 0
|
export_partdevice rootdev 0
|
||||||
case "$rootdev" in
|
case "$rootdev" in
|
||||||
mmc*)
|
mmc*)
|
||||||
|
blockdev --rereadpt /dev/$rootdev || return 1
|
||||||
local fitpart=$(get_partition_by_name $rootdev "production")
|
local fitpart=$(get_partition_by_name $rootdev "production")
|
||||||
[ "$fitpart" ] || return 1
|
[ "$fitpart" ] || return 1
|
||||||
dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null
|
dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null
|
||||||
|
@ -86,6 +86,7 @@ platform_do_upgrade() {
|
|||||||
bananapi,bpi-r2)
|
bananapi,bpi-r2)
|
||||||
export_bootdevice
|
export_bootdevice
|
||||||
export_partdevice rootdev 0
|
export_partdevice rootdev 0
|
||||||
|
blockdev --rereadpt /dev/$rootdev || return 1
|
||||||
export_partdevice fitpart 3
|
export_partdevice fitpart 3
|
||||||
[ "$fitpart" ] || return 1
|
[ "$fitpart" ] || return 1
|
||||||
dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null
|
dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user