Author: blogic
Date: 2015-04-09 16:33:03 +0200 (Thu, 09 Apr 2015)
New Revision: 45338

Modified:
   trunk/package/base-files/files/sbin/sysupgrade
Log:
base-files: add support for platform_pre_upgrade function

Current NAND sysupgrade process is a bit hard to follow due to the way
of triggering stage1. Currently this is done by leaving a /mark/ in the
form of /tmp/sysupgrade-nand-path during nand_do_platform_check.
Existence of this mark stops standard sysupgrade process (as the result
of sysupgrade_pre_upgrade exit). This may be a bit misleading.

Proposed solution adds a new function that will allow platform.sh
trigger NAND sysupgrade consciously. This will also allow cleaning
nand_do_platform_check limiting it to just checking the image.

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

Modified: trunk/package/base-files/files/sbin/sysupgrade
===================================================================
--- trunk/package/base-files/files/sbin/sysupgrade      2015-04-09 10:33:26 UTC 
(rev 45337)
+++ trunk/package/base-files/files/sbin/sysupgrade      2015-04-09 14:33:03 UTC 
(rev 45338)
@@ -215,6 +215,14 @@
 
 run_hooks "" $sysupgrade_pre_upgrade
 
+# Some platforms/devices may want different sysupgrade process, e.g. without
+# killing processes yet or calling ubus system upgrade method.
+# This is needed e.g. on NAND devices where we just want to trigger stage1 at
+# this point.
+if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
+       platform_pre_upgrade "$ARGV"
+fi
+
 ubus call system upgrade
 touch /tmp/sysupgrade
 
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to