diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2020-11-18 13:07:04 +0200 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-11-18 09:29:03 -0600 |
commit | 2fa25adbafce346f9fc1ba76cb00950ea2dbafc6 (patch) | |
tree | e52f6675f42465c86d6786cbc0783acc061e9d88 /recipes-core | |
parent | 11c8ff37c6889c6f161a129999064f70f68862e0 (diff) | |
download | meta-mlinux-2fa25adbafce346f9fc1ba76cb00950ea2dbafc6.tar.gz meta-mlinux-2fa25adbafce346f9fc1ba76cb00950ea2dbafc6.tar.bz2 meta-mlinux-2fa25adbafce346f9fc1ba76cb00950ea2dbafc6.zip |
GP-908 mtr7 does not reset data in the /var/persistent folder during reset to factory defaults
Diffstat (limited to 'recipes-core')
-rwxr-xr-x | recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh b/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh index 199fc17..cb5b862 100755 --- a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh +++ b/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh @@ -69,6 +69,7 @@ ROOT_RWDEVICE="" ROOT_ROMOUNT="/run/media/rfs/ro" ROOT_RWMOUNT="/run/media/rfs/rw" ROOT_RWRESET="no" +DO_ERASE_USERDATA_FILE="$ROOT_RWMOUNT/.persistent/mts_do_erase_userdata" ROOT_ROFSTYPE="" ROOT_ROMOUNTOPTIONS="bind" @@ -277,8 +278,14 @@ mount_and_boot() { # Reset read-write file system if specified log "ROOT_RWRESET=$ROOT_RWRESET ROOT_RWMOUNT=$ROOT_RWMOUNT" if [ "yes" == "$ROOT_RWRESET" -a -n "${ROOT_RWMOUNT}" ]; then # JAK - log "Removing user_data files" + log "Removing user_data files" rm -rf $ROOT_RWMOUNT/* + if [ -f $DO_ERASE_USERDATA_FILE ]; then + log "Removing persistent user_data files" + shopt -s dotglob + rm -rf $ROOT_RWMOUNT/* + shopt -u dotglob + fi log "Completed removal of user_data files" fi |