Author: rmilecki
Date: 2015-04-14 22:50:59 +0200 (Tue, 14 Apr 2015)
New Revision: 45445

Modified:
   trunk/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
Log:
bcm53xx: add (disabled) support for upgrading kernel during sysupgrade

Signed-off-by: Rafa?\197?\130 Mi?\197?\130ecki <[email protected]>

Modified: trunk/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
===================================================================
--- trunk/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh       
2015-04-14 20:50:53 UTC (rev 45444)
+++ trunk/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh       
2015-04-14 20:50:59 UTC (rev 45445)
@@ -150,6 +150,23 @@
 
        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() {
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to