init: Wait for /dev/hvc1 during ARCVM first-stage mount
This commit introduces a function to allow ARC-specific logic during
first-stage mount by checking for the existence of an indicator file
at the path "/is_arcvm".
ARC uses the virtio-console device `hvc1` to pass byte data to Android
before second-stage init. Ensure that /dev/hvc1 is initialized before
ARCVM continues booting, but allow other devices to bypass this device
initialization.
Bug: 325538592
Test: boot ARC, ensure /dev/hvc1 can be read during PropertyInit
Change-Id: Ic258b7b004b59da462f4990131a5c11fc94eca62
diff --git a/init/selinux.cpp b/init/selinux.cpp
index c2d9b8d..01af2b6 100644
--- a/init/selinux.cpp
+++ b/init/selinux.cpp
@@ -474,6 +474,8 @@
RestoreconIfExists(SnapshotManager::GetGlobalRollbackIndicatorPath().c_str(), 0);
RestoreconIfExists("/metadata/gsi",
SELINUX_ANDROID_RESTORECON_RECURSE | SELINUX_ANDROID_RESTORECON_SKIP_SEHASH);
+
+ RestoreconIfExists("/dev/hvc1", 0);
}
int SelinuxKlogCallback(int type, const char* fmt, ...) {