Add support for shared virtiofs mount
Create a "shared" directory under cuttlefish_runtime.X which is
unconditionally shared with the guest. This virtiofs filesystem is
mounted at /mnt/vendor/shared and is accessible only to root. This
is similar to how 'persist' works on Pixel.
Implementing this for QEMU is postponed for now; the feature was only
added in QEMU 5.0 and requires a new subprocess called virtiofsd to
be started; we can revisit this when QEMU 5.0 has rolled out to more
places. Added "nofail" to the fstab to accommodate this.
Bug: 161843089
Change-Id: Id69404f0ac55ec5f1aff11412e648fb5260a3f2c
diff --git a/shared/sepolicy/vendor/init.te b/shared/sepolicy/vendor/init.te
index 2678592..e56edfd 100644
--- a/shared/sepolicy/vendor/init.te
+++ b/shared/sepolicy/vendor/init.te
@@ -18,3 +18,6 @@
# /mnt/sdcard -> /storage/self/primary symlink is deprecated. Ignore attempts to
# create it. This denial is fixed in core policy in Android R aosp/943799.
dontaudit init tmpfs:lnk_file create;
+
+# permit mount of virtiofs on /mnt/vendor/shared
+allow init mnt_vendor_file:dir mounton;