aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-04-14 20:50:59 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-04-14 20:50:59 +0000
commit8614d100c81f6368b7f305a951605433257909a5 (patch)
tree162875ca084eb7e1a945c3b65a026235d6b5c35c /target/linux
parent9f3b827af2a4702fb5c9d4398249dd4af53909a9 (diff)
downloadupstream-8614d100c81f6368b7f305a951605433257909a5.tar.gz
upstream-8614d100c81f6368b7f305a951605433257909a5.tar.bz2
upstream-8614d100c81f6368b7f305a951605433257909a5.zip
bcm53xx: add (disabled) support for upgrading kernel during sysupgrade
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45445 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/bcm53xx/base-files/lib/upgrade/platform.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
index 876da4d6f8..034fb8e6b8 100644
--- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
@@ -150,6 +150,23 @@ platform_pre_upgrade() {
echo "Provided firmware contains kernel and UBI image, but flashing it is unsupported yet"
exit 1
+
+ # Prepare TRX file with just a kernel that will replace current one
+ local linux_length=$(grep "\"linux\"" /proc/mtd | sed "s/mtd[0-9]*:[ \t]*\([^ \t]*\).*/\1/")
+ [ -z "$linux_length" ] && {
+ echo "Unable to find \"linux\" partition size"
+ exit 1
+ }
+ linux_length=$((0x$linux_length + 28))
+ rm -f /tmp/null.bin
+ rm -f /tmp/kernel.trx
+ touch /tmp/null.bin
+ otrx create /tmp/kernel.trx \
+ -f $dir/kernel -b $linux_length \
+ -f /tmp/null.bin
+
+ # Flash
+ mtd write /tmp/kernel.trx firmware
}
platform_do_upgrade() {