aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/rb532/base-files/lib/upgrade/platform.sh
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/rb532/base-files/lib/upgrade/platform.sh')
-rw-r--r--target/linux/rb532/base-files/lib/upgrade/platform.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/rb532/base-files/lib/upgrade/platform.sh b/target/linux/rb532/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000000..29fe18de30
--- /dev/null
+++ b/target/linux/rb532/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,26 @@
+REQUIRE_IMAGE_METADATA=1
+RAMFS_COPY_BIN=/usr/sbin/nandwrite
+CI_KERNPART=none
+
+platform_check_image() {
+ [ -e /dev/ubi0 ] || {
+ ubiattach -m 1
+ sleep 1
+ }
+ return 0;
+}
+
+platform_pre_upgrade() {
+ nand_do_upgrade "$1"
+}
+
+platform_nand_pre_upgrade() {
+ local board_name="$(cat /tmp/sysinfo/board_name)"
+
+ mtd erase kernel
+ tar xf "$1" sysupgrade-$board_name/kernel -O | nandwrite -o /dev/mtd0 -
+}
+
+platform_do_upgrade() {
+ default_do_upgrade "$ARGV"
+}