From 12e34516aa2df00459f688abd70c506606c11f80 Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Wed, 26 Jan 2022 17:05:07 +0200 Subject: MTX-4363 mPower R.6.0.x: MTCAP3 - Reset overlayfs when switching rootfs on the boot counter overflow GP-1454 --- recipes-core/multitech/overlayfs-init-ubi/overlayfs.init | 6 +++--- recipes-core/multitech/overlayfs-init-ubi_0.1.bb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'recipes-core') diff --git a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init index 0000f29..c23a1ce 100644 --- a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init +++ b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init @@ -12,7 +12,7 @@ USER_PARTITION="ubi0:user-data" # Erase the file system DO_ERASE_PERSISTENT="/mnt/user/.persistent/mts_do_erase_persistent" # Remove files not hidden -DO_CLEAR_PERSISTENT="/mnt/user/.persistent/mts_do_clear_persistent" +DO_CLEAR_PERSISTENT=$(fw_printenv default_reset_f | cut -d '"' -f2 | grep -Eo '[0-9]+$' || true) pid=$$ prefix="<3>overlayrootfs-generator[${pid}]: " @@ -69,7 +69,7 @@ do_clear_old() { mv "$FILE_PATH" "$MNT_USER/$FILE_NAME.old" 2>&1 | logpipe done do_remove_old - rm -f $DO_CLEAR_PERSISTENT + fw_setenv default_reset_f 0 } # Most efficient way to clear UBIFS file system @@ -99,7 +99,7 @@ do_rw_mount() { if [[ -f $DO_ERASE_PERSISTENT ]] ; then do_erase_old - elif [[ -f $DO_CLEAR_PERSISTENT ]] ; then + elif [[ "$DO_CLEAR_PERSISTENT" -eq 1 ]] ; then do_clear_old fi diff --git a/recipes-core/multitech/overlayfs-init-ubi_0.1.bb b/recipes-core/multitech/overlayfs-init-ubi_0.1.bb index a14ed2e..be7ea36 100644 --- a/recipes-core/multitech/overlayfs-init-ubi_0.1.bb +++ b/recipes-core/multitech/overlayfs-init-ubi_0.1.bb @@ -3,7 +3,7 @@ HOMEPAGE = "http://www.multitech.com/" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" PACKAGE_ARCH = "all" -PR = "r5" +PR = "6" RDEPENDS_${PN} += "bash" SRC_URI = " \ -- cgit v1.2.3