From: Rafał Miłecki <[email protected]>

The only step between platform_pre_upgrade() and platform_do_upgrade()
is switching to ramdisk. It should be fine to call "jffs2reset" &
"umount" from the later callback and get rid of the first one.

Signed-off-by: Rafał Miłecki <[email protected]>
---
 .../imx6/base-files/lib/upgrade/platform.sh    | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh 
b/target/linux/imx6/base-files/lib/upgrade/platform.sh
index c3be9d5424..358c4c9707 100755
--- a/target/linux/imx6/base-files/lib/upgrade/platform.sh
+++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh
@@ -26,6 +26,11 @@ apalis_do_upgrade() {
        local board_name=$(board_name)
        board_name=${board_name/,/_}
 
+       [ "$SAVE_CONFIG" -eq 0 ] && {
+               jffs2reset -y
+               umount /overlay
+       }
+
        apalis_mount_boot
        get_image "$1" | tar Oxf - sysupgrade-${board_name}/kernel > 
/boot/uImage
        get_image "$1" | tar Oxf - sysupgrade-${board_name}/root > 
$(rootpart_from_uuid)
@@ -72,16 +77,3 @@ platform_copy_config() {
                ;;
        esac
 }
-
-platform_pre_upgrade() {
-       local board=$(board_name)
-
-       case "$board" in
-       apalis*)
-               [ "$SAVE_CONFIG" -eq 0 ] && {
-                       jffs2reset -y
-                       umount /overlay
-               }
-               ;;
-       esac
-}
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to