diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-06-06 17:05:31 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-06-06 17:05:31 +0000 |
commit | 5e90144aec50f1a394f62ef4691c7c51f5517cbe (patch) | |
tree | 4977b953205c8960479fdd2bb11db7d8b24fc411 /target/linux/bcm53xx/base-files/lib/upgrade | |
parent | 5621a56d25f7c7be9814c70ae1a4777a9c56e73c (diff) | |
download | master-31e0f0ae-5e90144aec50f1a394f62ef4691c7c51f5517cbe.tar.gz master-31e0f0ae-5e90144aec50f1a394f62ef4691c7c51f5517cbe.tar.bz2 master-31e0f0ae-5e90144aec50f1a394f62ef4691c7c51f5517cbe.zip |
bcm53xx: sysupgrade: extract TRX partitions directly from vendor image
Extracting full TRX out of vendor format is not needed as otrx supports
passing TRX offset. This saves some RAM during sysupgrade.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 45911
Diffstat (limited to 'target/linux/bcm53xx/base-files/lib/upgrade')
-rw-r--r-- | target/linux/bcm53xx/base-files/lib/upgrade/platform.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 88629549dc..4920b55caf 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -123,19 +123,21 @@ platform_pre_upgrade() { local file_type=$(platform_identify "$1") local dir="/tmp/sysupgrade-bcm53xx" local trx="$1" + local offset [ "$(platform_flash_type)" != "nand" ] && return - # Extract trx + # Find trx offset case "$file_type" in - "chk") trx="/tmp/$(basename $1).trx"; platform_extract_trx_from_chk "$1" "$trx";; - "cybertan") trx="/tmp/$(basename $1).trx"; platform_extract_trx_from_cybertan "$1" "$trx";; + "chk") offset=$((0x$(get_magic_long_at "$1" 4)));; + "cybertan") offset=32;; esac # Extract partitions from trx rm -fR $dir mkdir -p $dir otrx extract "$trx" \ + ${offset:+-o $offset} \ -1 $dir/kernel \ -2 $dir/root |