diff options
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 |