From 1fc4b94237a7cf48fe3360b3305302d943b8f1e1 Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Thu, 6 Nov 2025 13:58:51 +1000 Subject: [PATCH] Streamline udev rules --- 60-cros_ec_python.rules | 7 ------- README.md | 6 ++++-- add-udev-rules.sh | 7 +++++++ data/au.stevetech.yafi.metainfo.xml.in | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 60-cros_ec_python.rules create mode 100755 add-udev-rules.sh diff --git a/60-cros_ec_python.rules b/60-cros_ec_python.rules deleted file mode 100644 index 8fc61f9..0000000 --- a/60-cros_ec_python.rules +++ /dev/null @@ -1,7 +0,0 @@ -# CrOS_EC_Python udev rules - -# LPC Access -KERNEL=="port", TAG+="uaccess" - -# /dev/cros_ec Access -KERNEL=="cros_ec", TAG+="uaccess" diff --git a/README.md b/README.md index 9f77afc..c10b12d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ YAFI is also available on [Flathub](https://flathub.org/en/apps/au.stevetech.yaf ### 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 @@ -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'` -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.` diff --git a/add-udev-rules.sh b/add-udev-rules.sh new file mode 100755 index 0000000..bc88c57 --- /dev/null +++ b/add-udev-rules.sh @@ -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. diff --git a/data/au.stevetech.yafi.metainfo.xml.in b/data/au.stevetech.yafi.metainfo.xml.in index 05ec157..d53d0ca 100644 --- a/data/au.stevetech.yafi.metainfo.xml.in +++ b/data/au.stevetech.yafi.metainfo.xml.in @@ -19,6 +19,8 @@

You will need to install the udev rules to allow non-root access to the EC device. See the README for more information.

+

Alternatively, you can run curl -fL yafi.stevetech.au/udev.sh | sudo sh to install the udev rules.

+

YAFI is not affiliated with Framework Computer Inc. in any way.