From: Walter Fetter Lages Date: Thu, 31 May 2018 20:14:59 +0000 (-0300) Subject: Add udev rule to configure /dev/i2c-*. X-Git-Url: http://git.ece.ufrgs.br/?a=commitdiff_plain;h=f5982261f7f9bfe1a39b8d739a3e6c2693e373ac;p=st25_i2c.git Add udev rule to configure /dev/i2c-*. --- diff --git a/.gitignore b/.gitignore index c02f83a..982c590 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # C++ # Prerequisites *.d +!udev/rules.d # Compiled Object files *.slo diff --git a/README b/README new file mode 100644 index 0000000..d6a3902 --- /dev/null +++ b/README @@ -0,0 +1,18 @@ +The user should have read and write access to /dev/i2c-0 (or the +corresponding device if there is more than on I2C bus). + +The recomended way to grand the required premissions is to incude the user +in the i2c group: + +groupadd -r i2c +groupmems -g i2c -a + +and set the /dev/i2c-0 read and write permissions to this group by +installing the file 99-i2c-dev.rules in the /etc/udev/rules.d directory and +reloading the udev rules and the i2c-dev module with the commands: + +udvadm control -R +rmmod i2c-dev +modprobe i2c-dev + + diff --git a/udev/rules.d/99-i2c-dev.rules b/udev/rules.d/99-i2c-dev.rules new file mode 100644 index 0000000..b854019 --- /dev/null +++ b/udev/rules.d/99-i2c-dev.rules @@ -0,0 +1,2 @@ +KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660" +