[OpenWrt-Devel] [PATCH 2/3] imx6: get rid of platform_pre_upgrade()

Rafał Miłecki zajec5 at gmail.com
Fri Jul 12 08:05:48 EDT 2019


From: Rafał Miłecki <rafal at milecki.pl>

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 <rafal at milecki.pl>
---
 .../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
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list