summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2023-05-22 13:05:41 +0300
committerSerhii Voloshynov <serhii.voloshynov@globallogic.com>2023-05-24 13:54:42 +0300
commit6fb979d380594a150ca8915c43ae3bed9a4a13a9 (patch)
tree4a1c3d8b114361c6846b77c5e3d586d6ab2729a9
parentd52e5da8e40f0a96d2873a571dff26896ab9b916 (diff)
downloadmeta-mlinux-6fb979d380594a150ca8915c43ae3bed9a4a13a9.tar.gz
meta-mlinux-6fb979d380594a150ca8915c43ae3bed9a4a13a9.tar.bz2
meta-mlinux-6fb979d380594a150ca8915c43ae3bed9a4a13a9.zip
failed to perform firmware upgrade and reset to factory defaults when there is no space on /var/persistent GP-1997
use u-boot env as erase persistent flag
-rw-r--r--recipes-core/multitech/overlayfs-init-ubi/overlayfs.init8
1 files changed, 5 insertions, 3 deletions
diff --git a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
index f19abef..9e60961 100644
--- a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
+++ b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
@@ -10,7 +10,7 @@ LOWERDIR="/"
USER_ORIG="$UPPERDIR/orig"
USER_PARTITION="ubi0:user-data"
# Erase the file system
-DO_ERASE_PERSISTENT="/mnt/user/.persistent/mts_do_erase_persistent"
+DO_ERASE_PERSISTENT=$(fw_printenv erase_persistent_f | cut -d '"' -f2 | grep -Eo '[0-9]+$' || true)
# Remove files not hidden
DO_CLEAR_PERSISTENT=$(fw_printenv default_reset_f | cut -d '"' -f2 | grep -Eo '[0-9]+$' || true)
@@ -34,7 +34,7 @@ mnt_user() {
fs="/run /dev /proc /sys /sys/kernel/security /dev/shm /dev/pts /sys/fs/cgroup /sys/fs/cgroup/unified
/sys/fs/cgroup/systemd /sys/fs/cgroup/devices /sys/fs/cgroup/freezer /sys/fs/cgroup/pids /sys/fs/cgroup/memory
/dev/mqueue /sys/kernel/debug /tmp /sys/fs/fuse/connections /sys/kernel/config /var/volatile"
-
+
my_switch_root() {
NEW_ROOT=$1
loginfo mountinfo
@@ -88,6 +88,7 @@ do_erase_old() {
ubiupdatevol ${DEV} -t 2>&1 | logpipe
mnt_user
+ fw_setenv erase_persistent_f 0
}
do_rw_mount() {
@@ -97,8 +98,9 @@ do_rw_mount() {
mnt_user # user_data is now accessible
do_remove_old
- if [[ -f $DO_ERASE_PERSISTENT ]] ; then
+ if [[ "$DO_ERASE_PERSISTENT" -eq 1 ]] ; then
do_erase_old
+ fw_setenv default_reset_f 0
elif [[ "$DO_CLEAR_PERSISTENT" -eq 1 ]] ; then
do_clear_old
fi