diff options
author | John Crispin <blogic@openwrt.org> | 2015-06-05 14:12:05 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-06-05 14:12:05 +0000 |
commit | d831148740739687eba9fb54d7e8414dc41037f4 (patch) | |
tree | 0838a6d4403d5c77ef9617a2940f3e45a31745ee /package/base-files/files | |
parent | 2a0f4f1f4ea30e65205fdeb244e5aa0c3dd8ac77 (diff) | |
download | upstream-d831148740739687eba9fb54d7e8414dc41037f4.tar.gz upstream-d831148740739687eba9fb54d7e8414dc41037f4.tar.bz2 upstream-d831148740739687eba9fb54d7e8414dc41037f4.zip |
base-files: default_do_upgrade: accept & forward image extraction command
get_image allows passing 2nd argument that is used in a pipe for
extracting firmware from a non-native format. By accepting such command
in default_do_upgrade we allow platforms to use this helper for vendor
specific images.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45900 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files')
-rw-r--r-- | package/base-files/files/lib/upgrade/common.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 8cdabc6bda..189ef69e95 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -212,12 +212,16 @@ jffs2_copy_config() { fi } +# Flash firmware to MTD partition +# +# $(1): path to image +# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m default_do_upgrade() { sync if [ "$SAVE_CONFIG" -eq 1 ]; then - get_image "$1" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}" + get_image "$1" "$2" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}" else - get_image "$1" | mtd write - "${PART_NAME:-image}" + get_image "$1" "$2" | mtd write - "${PART_NAME:-image}" fi } |