aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-11-24 19:14:17 +0000
committerJohn Crispin <john@openwrt.org>2014-11-24 19:14:17 +0000
commit19c18eba9377eb9ee549f8c663467e2cb6531db5 (patch)
tree86e36b49a3de251773f9cd2a956ab1cad08e41ca /package/system/procd/files
parentb994aca1e4893b513cd7a853ee7e57db505c1097 (diff)
downloadupstream-19c18eba9377eb9ee549f8c663467e2cb6531db5.tar.gz
upstream-19c18eba9377eb9ee549f8c663467e2cb6531db5.tar.bz2
upstream-19c18eba9377eb9ee549f8c663467e2cb6531db5.zip
procd: document nand.sh a bit
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 43372
Diffstat (limited to 'package/system/procd/files')
-rw-r--r--package/system/procd/files/nand.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh
index f933629e8e..0d30810b83 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -201,6 +201,7 @@ nand_do_upgrade_success() {
reboot -f
}
+# Flash the UBI image to MTD partition
nand_upgrade_ubinized() {
local ubi_file="$1"
local mtdnum="$(find_mtd_index "$CI_UBIPART")"
@@ -223,6 +224,7 @@ nand_upgrade_ubinized() {
nand_do_upgrade_success
}
+# Write the UBIFS image to UBI volume
nand_upgrade_ubifs() {
local rootfs_length=`(cat $1 | wc -c) 2> /dev/null`
@@ -269,6 +271,7 @@ nand_upgrade_tar() {
nand_do_upgrade_success
}
+# Recognize type of passed file and start the upgrade process
nand_do_upgrade_stage2() {
local file_type=$(identify $1)
@@ -319,6 +322,19 @@ nand_upgrade_stage1() {
}
append sysupgrade_pre_upgrade nand_upgrade_stage1
+# Check if passed file is a valid one for NAND sysupgrade. Currently it accepts
+# 3 types of files:
+# 1) UBI - should contain an ubinized image, header is checked for the proper
+# MAGIC
+# 2) UBIFS - should contain UBIFS partition that will replace "rootfs" volume,
+# header is checked for the proper MAGIC
+# 3) TRX - archive has to include "sysupgrade-BOARD" directory with a non-empty
+# "CONTROL" file (at this point its content isn't verified)
+#
+# You usually want to call this function in platform_check_image.
+#
+# $(1): board name, used in case of passing TRX file
+# $(2): file to be checked
nand_do_platform_check() {
local board_name="$1"
local tar_file="$2"