Prepare /data/property before load_persist_props
Without the directory (this happens on the very first boot),
load_persist_props can't create an initial version of
/data/property/persistent_properties (probably empty). This leads to
persisting all in-memory "persist.*" properties later when a persistent
property is set. This is regression from Android S because persistent
props from, for example, build.prop will be persisted even when there's
no process to explicitly setprop.
Bug: 242264580
Bug: 243958304
Test: launch cuttlefish and verify that there's no props from build.prop
Merged-In: I5819a97750e4d5d1ee5a7c308bf944c7aeab2f90
Change-Id: I5819a97750e4d5d1ee5a7c308bf944c7aeab2f90
(cherry picked from commit 95614963039be8500c6f2a81194e97e01b35bc7b)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index cd71aa8..c56f860 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -720,9 +720,13 @@
# Multi-installed APEXes are selected using persist props.
# Load persist properties and override properties (if enabled) from /data,
# before starting apexd.
+ # /data/property should be created before `load_persist_props`
+ mkdir /data/property 0700 root root encryption=Require
load_persist_props
+
start logd
start logd-reinit
+
# Some existing vendor rc files use 'on load_persist_props_action' to know
# when persist props are ready. These are difficult to change due to GRF,
# so continue triggering this action here even though props are already loaded
@@ -842,7 +846,6 @@
mkdir /data/app-asec 0700 root root encryption=Require
mkdir /data/app-lib 0771 system system encryption=Require
mkdir /data/app 0771 system system encryption=Require
- mkdir /data/property 0700 root root encryption=Require
# create directory for updated font files.
mkdir /data/fonts/ 0771 root root encryption=Require