From ff17114ba17f8e7c8b256f6f3a04640062a6d797 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 14 Nov 2013 19:38:54 +0000 Subject: ar71xx: Unifi AP Pro sysupgrade patch The current implementation of mtd will not append the backup file created by sysupgrade to the correct partition, as mtd will append the data to first jffs2 partition it finds. As the kernel is also stored on a jffs2 partition (which resides before the overlay partition), the data will be appended to this partition. To fix this problem, a new option -s skip the first n bytes when appending data to the jffs2 partiton, defaults to "0" is added to mtd. Signed-off-by: Peter Wagner SVN-Revision: 38807 --- package/base-files/files/lib/upgrade/common.sh | 2 +- package/base-files/files/sbin/sysupgrade | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'package/base-files') diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 9116206..6122ae7 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -188,7 +188,7 @@ jffs2_copy_config() { default_do_upgrade() { sync if [ "$SAVE_CONFIG" -eq 1 ]; then - get_image "$1" | mtd -j "$CONF_TAR" write - "${PART_NAME:-image}" + get_image "$1" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}" else get_image "$1" | mtd write - "${PART_NAME:-image}" fi diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index eb5ab03..14b09eb 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -4,6 +4,7 @@ # initialize defaults RAMFS_COPY_BIN="" # extra programs for temporary ramfs root RAMFS_COPY_DATA="" # extra data files +export MTD_CONFIG_ARGS="" export INTERACTIVE=0 export VERBOSE=1 export SAVE_CONFIG=1 -- cgit v1.1