Sysupgrade adapted from the bcm47xx one.

Add a hook to disable watchdog before upgrading.


Signed-off-by: Frédéric Moulins <[EMAIL PROTECTED]>

---

Worked for me :)

diff --git a/target/linux/adm5120/base-files/lib/upgrade/platform.sh 
b/target/linux/adm5120/base-files/lib/upgrade/platform.sh
new file mode 100644
--- /dev/null
+++ b/target/linux/adm5120/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,32 @@
+platform_check_image() {
+       [ "$ARGC" -gt 1 ] && return 1
+
+       case "$(get_magic_word "$1")" in
+               # .trx files
+               4844) return 0;;
+               *)
+                       echo "Invalid image type"
+                       return 1
+               ;;
+       esac
+}
+
+platform_do_upgrade() {
+       get_image "$1" > $UPGRADE_PARTITION
+       sync
+}
+
+adm5120_prepare_mtd() {
+       export UPGRADE_PARTITION=$(find_mtd_part "partition1")
+       [ "$SAVE_CONFIG" -eq 1 ] && return 0
+}
+append sysupgrade_pre_upgrade adm5120_prepare_mtd
+
+disable_watchdog() {
+       killall watchdog
+       ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
+               echo 'Could not disable watchdog'
+               return 1
+       }
+}
+append sysupgrade_pre_upgrade disable_watchdog
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to