-RAMFS_COPY_BIN='osafeloader oseama'
+RAMFS_COPY_BIN='osafeloader oseama otrx'
PART_NAME=firmware
# $(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"
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
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)))
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."
}