Streamline udev rules

This commit is contained in:
Stephen Horvath
2025-11-06 13:58:51 +10:00
parent 90a994a685
commit 1fc4b94237
4 changed files with 13 additions and 9 deletions

View File

@@ -1,7 +0,0 @@
# CrOS_EC_Python udev rules
# LPC Access
KERNEL=="port", TAG+="uaccess"
# /dev/cros_ec Access
KERNEL=="cros_ec", TAG+="uaccess"

View File

@@ -15,7 +15,9 @@ YAFI is also available on [Flathub](https://flathub.org/en/apps/au.stevetech.yaf
### Linux ### Linux
To allow YAFI to communicate with the EC, you need to copy the [`60-cros_ec_python.rules`](60-cros_ec_python.rules) file to `/etc/udev/rules.d/` and reload the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`. To allow YAFI to communicate with the EC, you will need to enable user access to the `/dev/cros_ec` device. You can do this by running `echo KERNEL=="cros_ec", TAG+="uaccess" | sudo tee /etc/udev/rules.d/60-yafi.rules`, and then reload the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`.
You can also do this by running `curl -fL yafi.stevetech.au/udev.sh | sudo sh` which will run the [`add-udev-rules.sh`](add-udev-rules.sh) script.
### Windows ### Windows
@@ -84,7 +86,7 @@ It is possible to run YAFI on Windows using [gvsbuild](https://github.com/wingtk
### `[Errno 13] Permission denied: '/dev/cros_ec'` ### `[Errno 13] Permission denied: '/dev/cros_ec'`
This error occurs when the udev rules are not installed or not working. Make sure you have copied the `60-cros_ec_python.rules` file to `/etc/udev/rules.d/` and reloaded the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`. This error occurs when the udev rules are not installed or not working. Make sure you have installed the udev rules as described in the [Linux Installation](#linux) section.
### `Could not auto detect device, check you have the required permissions, or specify manually.` ### `Could not auto detect device, check you have the required permissions, or specify manually.`

7
add-udev-rules.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -e
echo Installing udev rules for YAFI to /etc/udev/rules.d/60-yafi.rules
echo KERNEL=="cros_ec", TAG+="uaccess" > /etc/udev/rules.d/60-yafi.rules
udevadm control --reload-rules
udevadm trigger
echo udev rules installed successfully.

View File

@@ -19,6 +19,8 @@
<p>You will need to install the udev rules to allow non-root access to the EC device. See the README for more information.</p> <p>You will need to install the udev rules to allow non-root access to the EC device. See the README for more information.</p>
<p>Alternatively, you can run <code>curl -fL yafi.stevetech.au/udev.sh | sudo sh</code> to install the udev rules.</p>
<p>YAFI is not affiliated with Framework Computer Inc. in any way.</p> <p>YAFI is not affiliated with Framework Computer Inc. in any way.</p>
</description> </description>