diff options
author | Rodrigo Balerdi <lanchon@gmail.com> | 2022-04-15 06:42:51 -0300 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-04-19 16:28:25 +0100 |
commit | de4b65a793f8b7222d19f7507e7d3d93a0677597 (patch) | |
tree | db6147b1a5bb8617bef2d154fd67044a5f7ba582 /package/base-files | |
parent | 264d9483025c9604709879094810f25e6c9fac38 (diff) | |
download | upstream-de4b65a793f8b7222d19f7507e7d3d93a0677597.tar.gz upstream-de4b65a793f8b7222d19f7507e7d3d93a0677597.tar.bz2 upstream-de4b65a793f8b7222d19f7507e7d3d93a0677597.zip |
base-files: clean up ubinized sysupgrade code
Remove redundant check from nand ubinized sysupgrade code. This check
has already been done in the only caller of the affected function:
nand_do_upgrade.
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Diffstat (limited to 'package/base-files')
-rw-r--r-- | package/base-files/files/lib/upgrade/nand.sh | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 67c6a620b1..c7ec59cb22 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -236,11 +236,6 @@ nand_upgrade_ubinized() { local ubi_file="$1" local mtdnum="$(find_mtd_index "$CI_UBIPART")" - [ ! "$mtdnum" ] && { - CI_UBIPART="rootfs" - mtdnum="$(find_mtd_index "$CI_UBIPART")" - } - if [ ! "$mtdnum" ]; then echo "cannot find mtd device $CI_UBIPART" umount -a @@ -248,10 +243,11 @@ nand_upgrade_ubinized() { fi local mtddev="/dev/mtd${mtdnum}" - ubidetach -p "${mtddev}" || true + ubidetach -p "${mtddev}" || : sync ubiformat "${mtddev}" -y -f "${ubi_file}" ubiattach -p "${mtddev}" + nand_do_upgrade_success } @@ -333,7 +329,7 @@ nand_upgrade_tar() { nand_do_upgrade() { local file_type=$(identify $1) - [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" + [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs case "$file_type" in "fit") nand_upgrade_fit $1;; |