Skip to content

Commit 1fc4b94

Browse files
committed
Streamline udev rules
1 parent 90a994a commit 1fc4b94

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

60-cros_ec_python.rules

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ YAFI is also available on [Flathub](https://flathub.org/en/apps/au.stevetech.yaf
1515

1616
### Linux
1717

18-
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`.
18+
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`.
19+
20+
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.
1921

2022
### Windows
2123

@@ -84,7 +86,7 @@ It is possible to run YAFI on Windows using [gvsbuild](https://github.com/wingtk
8486

8587
### `[Errno 13] Permission denied: '/dev/cros_ec'`
8688

87-
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`.
89+
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.
8890

8991
### `Could not auto detect device, check you have the required permissions, or specify manually.`
9092

add-udev-rules.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
echo Installing udev rules for YAFI to /etc/udev/rules.d/60-yafi.rules
4+
echo KERNEL=="cros_ec", TAG+="uaccess" > /etc/udev/rules.d/60-yafi.rules
5+
udevadm control --reload-rules
6+
udevadm trigger
7+
echo udev rules installed successfully.

data/au.stevetech.yafi.metainfo.xml.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
<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>
2121

22+
<p>Alternatively, you can run <code>curl -fL yafi.stevetech.au/udev.sh | sudo sh</code> to install the udev rules.</p>
23+
2224
<p>YAFI is not affiliated with Framework Computer Inc. in any way.</p>
2325
</description>
2426

0 commit comments

Comments
 (0)