From 11ec1256c5544a7547496a52ea71e00abaa16de2 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 22 Jun 2021 14:51:07 -0400 Subject: [PATCH] WIFI-2681: Allow re-trying a failed upgrade Signed-off-by: Owen Anderson --- feeds/wlan-ap/opensync/files/bin/flash-firmware | 3 ++- .../opensync/patches/39-allow-upgrade-retry.patch | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 feeds/wlan-ap/opensync/patches/39-allow-upgrade-retry.patch diff --git a/feeds/wlan-ap/opensync/files/bin/flash-firmware b/feeds/wlan-ap/opensync/files/bin/flash-firmware index 6552fe1dd..318af6c2d 100755 --- a/feeds/wlan-ap/opensync/files/bin/flash-firmware +++ b/feeds/wlan-ap/opensync/files/bin/flash-firmware @@ -24,7 +24,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -IMGFILE="$(ls ${1}.*)" +# Get the most recent upgrade file available +IMGFILE="$(ls -t1 ${1}.* | head -n 1)" if [ -z "$IMGFILE" ] || [ ! -f "$IMGFILE" ] ; then echo diff --git a/feeds/wlan-ap/opensync/patches/39-allow-upgrade-retry.patch b/feeds/wlan-ap/opensync/patches/39-allow-upgrade-retry.patch new file mode 100644 index 000000000..14add5414 --- /dev/null +++ b/feeds/wlan-ap/opensync/patches/39-allow-upgrade-retry.patch @@ -0,0 +1,12 @@ +--- a/src/um/src/um_ovsdb.c ++++ b/src/um/src/um_ovsdb.c +@@ -356,7 +356,8 @@ static void callback_AWLAN_Node( + //TODO Is there something that needs to be done here? + } + +- if(awlan_node->upgrade_timer_changed){ ++ if(awlan_node->upgrade_timer_changed ++ || ((awlan_node->firmware_url_changed) && (strlen(awlan_node->firmware_url) > 0))) { + if (awlan_node->upgrade_timer > 0) + { + /* if there is active timer, stop it to set new value */