mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
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
This commit is contained in:
parent
5621a56d25
commit
5e90144aec
@ -123,19 +123,21 @@ platform_pre_upgrade() {
|
|||||||
local file_type=$(platform_identify "$1")
|
local file_type=$(platform_identify "$1")
|
||||||
local dir="/tmp/sysupgrade-bcm53xx"
|
local dir="/tmp/sysupgrade-bcm53xx"
|
||||||
local trx="$1"
|
local trx="$1"
|
||||||
|
local offset
|
||||||
|
|
||||||
[ "$(platform_flash_type)" != "nand" ] && return
|
[ "$(platform_flash_type)" != "nand" ] && return
|
||||||
|
|
||||||
# Extract trx
|
# Find trx offset
|
||||||
case "$file_type" in
|
case "$file_type" in
|
||||||
"chk") trx="/tmp/$(basename $1).trx"; platform_extract_trx_from_chk "$1" "$trx";;
|
"chk") offset=$((0x$(get_magic_long_at "$1" 4)));;
|
||||||
"cybertan") trx="/tmp/$(basename $1).trx"; platform_extract_trx_from_cybertan "$1" "$trx";;
|
"cybertan") offset=32;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Extract partitions from trx
|
# Extract partitions from trx
|
||||||
rm -fR $dir
|
rm -fR $dir
|
||||||
mkdir -p $dir
|
mkdir -p $dir
|
||||||
otrx extract "$trx" \
|
otrx extract "$trx" \
|
||||||
|
${offset:+-o $offset} \
|
||||||
-1 $dir/kernel \
|
-1 $dir/kernel \
|
||||||
-2 $dir/root
|
-2 $dir/root
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user