Delete stale Virtualization image files

Delete all files and directories under
/data/misc/virtualizationservice at boot. Originally they were owned
by the virtualizationservice user; we now run as system, and don't
have permission to remove them after boot.

Bug: 230056726
Test: Create fake stale dir+file, see them deleted
Change-Id: I5ff7d055aeeb25ba7693e50876d6b8a830c4bf51
(cherry picked from commit 34ee0c931c)
This commit is contained in:
Alan Stokes 2022-04-27 17:27:19 +01:00
parent a9eee03c56
commit df84dd93e5
1 changed files with 5 additions and 5 deletions

View File

@ -828,11 +828,11 @@ on post-fs-data
# directory used for odsign metrics
mkdir /data/misc/odsign/metrics 0770 root system
# Directory for VirtualizationService temporary image files. Always create
# a fresh new empty directory to remove any stale files from the previous
# boot.
rmdir /data/misc/virtualizationservice
mkdir /data/misc/virtualizationservice 0700 system system
# Directory for VirtualizationService temporary image files.
# Delete any stale files owned by the old virtualizationservice uid (b/230056726).
chmod 0770 /data/misc/virtualizationservice
exec - virtualizationservice system -- /bin/rm -rf /data/misc/virtualizationservice
mkdir /data/misc/virtualizationservice 0770 system system
mkdir /data/preloads 0775 system system encryption=None