|
@@ -387,9 +387,11 @@ nand_verify_tar_file() {
|
|
|
|
|
|
nand_do_flash_file() {
|
|
nand_do_flash_file() {
|
|
local file="$1"
|
|
local file="$1"
|
|
|
|
+ local cmd="$2"
|
|
|
|
+ local file_type
|
|
|
|
|
|
- local cmd="$(identify_if_gzip "$file")cat"
|
|
|
|
- local file_type="$(identify "$file" "$cmd" "")"
|
|
|
|
|
|
+ [ -z "$cmd" ] && cmd="$(identify_if_gzip "$file")cat"
|
|
|
|
+ file_type="$(identify "$file" "$cmd" "")"
|
|
|
|
|
|
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs
|
|
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs
|
|
|
|
|
|
@@ -423,17 +425,22 @@ nand_do_restore_config() {
|
|
# Supported firmware containers:
|
|
# Supported firmware containers:
|
|
# 1. Raw file
|
|
# 1. Raw file
|
|
# 2. Gzip
|
|
# 2. Gzip
|
|
|
|
+# 3. Custom (requires passing extracting command)
|
|
#
|
|
#
|
|
# Supported data formats:
|
|
# Supported data formats:
|
|
# 1. Tar with kernel/rootfs
|
|
# 1. Tar with kernel/rootfs
|
|
# 2. UBI image (built using "ubinized")
|
|
# 2. UBI image (built using "ubinized")
|
|
# 3. UBIFS image (to update UBI volume with)
|
|
# 3. UBIFS image (to update UBI volume with)
|
|
# 4. FIT image (to update UBI volume with)
|
|
# 4. FIT image (to update UBI volume with)
|
|
|
|
+#
|
|
|
|
+# $(1): firmware file path
|
|
|
|
+# $(2): (optional) pipe command to extract firmware
|
|
nand_do_upgrade() {
|
|
nand_do_upgrade() {
|
|
local file="$1"
|
|
local file="$1"
|
|
|
|
+ local cmd="$2"
|
|
|
|
|
|
sync
|
|
sync
|
|
- nand_do_flash_file "$file" && nand_do_upgrade_success
|
|
|
|
|
|
+ nand_do_flash_file "$file" "$cmd" && nand_do_upgrade_success
|
|
nand_do_upgrade_failed
|
|
nand_do_upgrade_failed
|
|
}
|
|
}
|
|
|
|
|