summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2023-05-22 13:05:41 +0300
committerJohn Klug <john.klug@multitech.com>2023-06-05 15:29:31 -0500
commit29469646169657a82ba2581091ab4909c6413339 (patch)
treee78a4253622a914936916d3ad8268dfc2fbd0f57
parentf67aec69a183088cb606695fa6de6e8e45f21aa1 (diff)
downloadmeta-mlinux-29469646169657a82ba2581091ab4909c6413339.tar.gz
meta-mlinux-29469646169657a82ba2581091ab4909c6413339.tar.bz2
meta-mlinux-29469646169657a82ba2581091ab4909c6413339.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