Add a version check for SELinux policy on device.
This helps to ensure that when a new system image is installed,
old userdata policy isn't applied over the top of it.
Bug: 8841348
Change-Id: I135af32250aa62979763e775842ce0af3c8b6f9f
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 4b4408f..4e8ff60 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -177,9 +177,6 @@
mkdir /cache/lost+found 0770 root root
on post-fs-data
- # reload SELinux based on what we find on the data partition
- selinux_reload_policy
-
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
@@ -263,6 +260,9 @@
#setprop vold.post_fs_data_done 1
on boot
+# reload SELinux policy to make sure we use the most up-to-date one
+ selinux_reload_policy
+
# basic network init
ifup lo
hostname localhost