Merge "Mount /mnt/vm earlier" into main am: 65daca3b88

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3261786

Change-Id: I98e3415b855b8f34e193c7f4004fdd4b208f3e79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 63e3d06..4b3ad82 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -495,6 +495,14 @@
     start hwservicemanager
     start vndservicemanager
 
+    # Mount /mnt/vm ASAP to allow early VMs to run.
+    mkdir /mnt/vm 0755 root root
+    mount tmpfs tmpfs /mnt/vm nosuid nodev noexec rw
+    restorecon /mnt/vm
+    chown system system /mnt/vm
+    chmod 0770 /mnt/vm
+    mkdir /mnt/vm/early 0770 system system
+
 # Run boringssl self test for each ABI.  Any failures trigger reboot to firmware.
 import /system/etc/init/hw/init.boringssl.${ro.zygote}.rc
 
@@ -661,14 +669,6 @@
     chmod 0755 /sys/kernel/tracing
     chmod 0755 /sys/kernel/debug/tracing
 
-    # Early HALs may use early VM. Mount /mnt/vm before starting such HALs.
-    mkdir /mnt/vm 0755 root root
-    mount tmpfs tmpfs /mnt/vm nosuid nodev noexec rw
-    restorecon /mnt/vm
-    chown system system /mnt/vm
-    chmod 0770 /mnt/vm
-    mkdir /mnt/vm/early 0770 system system
-
     # HALs required before storage encryption can get unlocked (FBE)
     class_start early_hal