I received the following contribution from Scott, who had obviously issues with the udev configuration. We had similar things already before, and I think it is time now to update our User's guide to preserve this info helping to setup the cxl device such normal users can access it.
I personally prefere a setup without the cxl group and just have 0666 and root as owner. Let's see.
Frank,
Your doc is a bit vague and sparse concerning udev rules, at least for ubuntu 16.04. In 16.04 the ref'ed dir is empty e.g.
root@smnorm:/etc/udev/rules.d# cd /etc/udev/rules.d/
root@smnorm:/etc/udev/rules.d# ls
root@smnorm:/etc/udev/rules.d#
Michael H used some of his instruction from the CAPI flash GT card to get non-root user to work, below is what he did. And that fixed the non-root user issue (not the path issues)
UDEV Rules / Device Permissions for /dev/cxl
Access to the CAPI device is restricted to members of the 'cxl' group. This configuration is controlled by udev rules, and triggered on reboot. To reconfigure this:
Ensure the 'cxl' group exists. Create it if it doesn't exist.
useradd --system --user-group cxl
Create /lib/udev/rules.d/80-cxl.rules as root:
sudo touch /lib/udev/rules.d/80-cxl.rules
Place the following in the 80-cxl.rules file:
SUBSYSTEM=="cxl", ATTRS{mode}=="dedicated_process", GROUP="cxl", MODE="0660"
SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", KERNEL=="afu[0-9]*.[0-9]m", OWNER="cxl", GROUP="cxl", MODE="0660"
SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", KERNEL=="afu[0-9].[0-9]*s", OWNER="cxl", GROUP="cxl", MODE="0660"
Add your user to the "cxl" group, then log out / log in:
adduser ubuntu cxl
Important
You must log out / log in to pick up new group membership for the currently-logged in user!
Retrigger udev to apply the correct permissions:
udevadm trigger -s cxl
Scott Carroll