[OpenWrt-Devel] [PATCH 1/2] nand upgrade: add 'platform_nand_pre_upgrade'

Nikolay Martynov mar.kolya at gmail.com
Sat Dec 12 01:45:26 EST 2015


Add 'platform_nand_pre_upgrade' callback to allow platform specific
preparation right before flashinng, when already in ramdisk.

Example uses might be setting correct values for CI_{KERNPART,UBIPART}.

Signed-off-by: Nikolay Martynov <mar.kolya at gmail.com>
---
 package/system/procd/files/nand.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh
index 0c179cb..8b0564d 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -275,6 +275,10 @@ nand_upgrade_tar() {
 nand_do_upgrade_stage2() {
 	local file_type=$(identify $1)
 
+	if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then
+		platform_nand_pre_upgrade "$1"
+	fi
+
 	[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs"
 
 	case "$file_type" in
-- 
2.6.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list