imx6: apalis: fix config survival after sysupgrade -n
authorPetr Štetiar <ynezz@true.cz>
Mon, 13 May 2019 14:42:41 +0000 (16:42 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 May 2019 19:19:48 +0000 (21:19 +0200)
This patch fixes `sysupgrade -n` when flashed with rootfs of the same
size as currently running, so the rootfs_data wouldn't get destroyed and
thus survive reboot. So let's fix it by always cleaning up the content
of the rootfs_data during sysupgrade.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
target/linux/imx6/base-files/lib/upgrade/platform.sh

index 2d76b6b4af337ea77b2b748d5b603cab33cddc92..c3be9d542416d111bcb86d0b42238552827450f3 100755 (executable)
@@ -72,3 +72,16 @@ platform_copy_config() {
                ;;
        esac
 }
+
+platform_pre_upgrade() {
+       local board=$(board_name)
+
+       case "$board" in
+       apalis*)
+               [ "$SAVE_CONFIG" -eq 0 ] && {
+                       jffs2reset -y
+                       umount /overlay
+               }
+               ;;
+       esac
+}