aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-07-02 16:10:56 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-04 13:25:14 +0200
commite98eab1b6b775afaec2c62071ca703ea75c6358a (patch)
tree5f607aa571a5fc65dc0123e8951b75ab809ffcb0 /target/linux/bcm53xx/base-files
parentebef2c27eb8a2840ae64ff51785a61f9752e59b1 (diff)
downloadupstream-e98eab1b6b775afaec2c62071ca703ea75c6358a.tar.gz
upstream-e98eab1b6b775afaec2c62071ca703ea75c6358a.tar.bz2
upstream-e98eab1b6b775afaec2c62071ca703ea75c6358a.zip
bcm53xx: sysupgrade: call nand_do_upgrade() from platform_do_upgrade()
Calling nand_do_upgrade() from platform_pre_upgrade() was obsoleted in the commit 30f61a34b4cf ("base-files: always use staged sysupgrade"). This change brings bcm53xx in sync with other targets and allows dropping backward compatibility code. It shouldn't change any user visible behavior. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit ccf8a8e8633ccfd94fda233b06055ac42e4c9fd5)
Diffstat (limited to 'target/linux/bcm53xx/base-files')
-rw-r--r--target/linux/bcm53xx/base-files/lib/upgrade/platform.sh29
1 files changed, 12 insertions, 17 deletions
diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
index 5a42a36ae4..1d829c6519 100644
--- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
@@ -1,4 +1,4 @@
-RAMFS_COPY_BIN='osafeloader oseama'
+RAMFS_COPY_BIN='osafeloader oseama otrx'
PART_NAME=firmware
@@ -147,7 +147,7 @@ platform_check_image() {
# $(1): image for upgrade (with possible extra header)
# $(2): offset of trx in image
-platform_pre_upgrade_trx() {
+platform_do_upgrade_nand_trx() {
local dir="/tmp/sysupgrade-bcm53xx"
local trx="$1"
local offset="$2"
@@ -210,7 +210,7 @@ platform_pre_upgrade_trx() {
nand_do_upgrade /tmp/root.ubi
}
-platform_pre_upgrade_seama() {
+platform_do_upgrade_nand_seama() {
local dir="/tmp/sysupgrade-bcm53xx"
local seama="$1"
local tmp
@@ -257,20 +257,6 @@ platform_pre_upgrade_seama() {
nand_do_upgrade $dir/root.ubi
}
-platform_pre_upgrade() {
- local file_type=$(platform_identify "$1")
-
- [ "$(platform_flash_type)" != "nand" ] && return
-
- # Find trx offset
- case "$file_type" in
- "chk") platform_pre_upgrade_trx "$1" $((0x$(get_magic_long_at "$1" 4)));;
- "cybertan") platform_pre_upgrade_trx "$1" 32;;
- "seama") platform_pre_upgrade_seama "$1";;
- "trx") platform_pre_upgrade_trx "$1";;
- esac
-}
-
platform_trx_from_chk_cmd() {
local header_len=$((0x$(get_magic_long_at "$1" 4)))
@@ -321,6 +307,15 @@ platform_do_upgrade() {
local cmd=
[ "$(platform_flash_type)" == "nand" ] && {
+ case "$file_type" in
+ "chk") platform_do_upgrade_nand_trx "$1" $((0x$(get_magic_long_at "$1" 4)));;
+ "cybertan") platform_do_upgrade_nand_trx "$1" 32;;
+ "seama") platform_do_upgrade_nand_seama "$1";;
+ "trx") platform_do_upgrade_nand_trx "$1";;
+ esac
+
+ # Above calls exit on success.
+ # If we got here something went wrong.
echo "Writing whole image to NAND flash. All erase counters will be lost."
}