From e467623483c40b8c791f29f5b8dd6a3f7edb9df5 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 7 May 2019 16:32:08 +0200 Subject: [PATCH] digiapix: update script and rules for watchdog and IIO The watchdog and ADC devices were not being modified to belong to 'digiapix' group, so the examples did not run properly when ran as a user different than root. Reported-by: Andreas Burghart Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-6581 --- .../libdigiapix/libdigiapix-git/99-digiapix.rules | 4 ++++ .../recipes-digi/libdigiapix/libdigiapix-git/digiapix.sh | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/99-digiapix.rules b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/99-digiapix.rules index f48d744cb..4da39ff7c 100644 --- a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/99-digiapix.rules +++ b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/99-digiapix.rules @@ -1,7 +1,10 @@ # libdigiapix: configure interfaces so they can be used by group 'digiapix' SUBSYSTEM=="i2c-dev", GROUP="digiapix", MODE="0660" +SUBSYSTEM=="iio", GROUP="digiapix", MODE="0660" +SUBSYSTEM=="misc", GROUP="digiapix", MODE="0660", ENV{DEVNAME}=="/dev/watchdog" SUBSYSTEM=="spidev", GROUP="digiapix", MODE="0660" +SUBSYSTEM=="watchdog",GROUP="digiapix", MODE="0660" # # Use two different rules for GPIO's. @@ -20,3 +23,4 @@ SUBSYSTEM=="gpio", KERNEL=="gpiochip0", ACTION=="add", RUN="/etc/udev/scripts/di SUBSYSTEM=="gpio", KERNEL!="gpiochip*", ACTION=="add", RUN="/etc/udev/scripts/digiapix.sh" SUBSYSTEM=="pwm", ACTION=="add|change", RUN="/etc/udev/scripts/digiapix.sh" +SUBSYSTEM=="iio", ACTION=="add", RUN="/etc/udev/scripts/digiapix.sh" diff --git a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/digiapix.sh b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/digiapix.sh index 8a9bdd26e..edab820d0 100644 --- a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/digiapix.sh +++ b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/digiapix.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017, Digi International Inc. +# Copyright (c) 2017-2019, Digi International Inc. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this @@ -28,8 +28,7 @@ elif basename "${DEVPATH}" | grep -qs "pwmchip[0-9]\+$" && [ "${ACTION}" = "chan chown root:digiapix /sys${DEVPATH}/${EXPORT} /sys${DEVPATH}/${EXPORT}/* chmod g+w /sys${DEVPATH}/${EXPORT}/* else - # Change group and mode of the sysfs files created whenever a 'gpioX' - # is exported + # Change group and mode of the sysfs files chown -h root:digiapix /sys${DEVPATH}/* chmod g+w /sys${DEVPATH}/* fi