Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb39f6e authored by Tiffany Yang's avatar Tiffany Yang
Browse files

init: Support for initializing virtio-console devices

This change allows init to ensure that a specified virtio-console
device file (`/dev/hvc*`) is available before `ueventd` coldboot.
Times out if device path is not encountered within 10 seconds.

Bug: 325538592
Test: build bertha_x86_64 and bertha_arm64
Change-Id: Ia1512e69ea607bf4d235595caa53668e2dac500c
parent 60d8d17f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@ bool BlockDevInitializer::InitPlatformDevice(const std::string& dev_name) {
    return InitDevice("/sys/devices/platform", dev_name);
}

bool BlockDevInitializer::InitHvcDevice(const std::string& dev_name) {
    return InitDevice("/sys/devices/virtual/tty", dev_name);
}

bool BlockDevInitializer::InitDevice(const std::string& syspath, const std::string& device_name) {
    bool found = false;

+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ class BlockDevInitializer final {
    bool InitDevices(std::set<std::string> devices);
    bool InitDmDevice(const std::string& device);
    bool InitPlatformDevice(const std::string& device);
    bool InitHvcDevice(const std::string& device);

  private:
    ListenerAction HandleUevent(const Uevent& uevent, std::set<std::string>* devices);