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

Commit e3774329 authored by Jakob Vukalovic's avatar Jakob Vukalovic
Browse files

ueventd: Fix creation of VFIO dev nodes

VFIO nodes, both the container (`vfio`) node and group (numbered)
nodes, should be located in `/dev/vfio`. This change prevents
ueventd from flattening that structure.

Test: Bind a device to VFIO driver to create a VFIO group
Change-Id: I635e9febe6bb52718df263e735479f361eacad4c
parent 4a33c22c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -568,6 +568,8 @@ void DeviceHandler::HandleUevent(const Uevent& uevent) {
        return;
    } else if (uevent.subsystem == "misc" && StartsWith(uevent.device_name, "dm-user/")) {
        devpath = "/dev/dm-user/" + uevent.device_name.substr(8);
    } else if (uevent.subsystem == "misc" && uevent.device_name == "vfio/vfio") {
        devpath = "/dev/" + uevent.device_name;
    } else {
        devpath = "/dev/" + Basename(uevent.path);
    }
+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ subsystem sound
subsystem dma_heap
   devname uevent_devpath
   dirname /dev/dma_heap

subsystem vfio
    devname uevent_devpath
    dirname /dev/vfio

# ueventd can only set permissions on device nodes and their associated
# sysfs attributes, not on arbitrary paths.
#
@@ -43,6 +48,7 @@ subsystem dma_heap
/dev/binder               0666   root       root
/dev/hwbinder             0666   root       root
/dev/vndbinder            0666   root       root
/dev/vfio/*               0666   root       root

/dev/pmsg0                0222   root       log
/dev/dma_heap/system      0444   system     system