Skip to content

Commit

Permalink
Merge pull request #25 from lsst-it/rhel9-gpio
Browse files Browse the repository at this point in the history
(files/imanager-init) handle rhel9+, with no /sys/class/gpio
  • Loading branch information
glennmorris authored Nov 16, 2023
2 parents f9ff165 + a890edb commit d12c101
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions files/imanager-init
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ groups ccs | grep -q gpio || usermod -a -G gpio ccs
modprobe imanager-core
modprobe gpio-imanager

[ -e /sys/class/gpio/export ] || exit 1
if [ -e /sys/class/gpio ]; then # <= rhel8

for ((n=504;n<=511;n++)); do
echo "$n" > /sys/class/gpio/export
done
[ -e /sys/class/gpio/export ] || exit 1

chmod g+w /sys/class/gpio/gpio{508..511}/value
chmod og+w /sys/class/gpio/gpio50*/value
for ((n=504;n<=511;n++)); do
echo "$n" > /sys/class/gpio/export
done

## These partially overlap, and it is not clear to me exactly what
## was wanted.
chmod g+w /sys/class/gpio/gpio{508..511}/value
chmod og+w /sys/class/gpio/gpio50*/value

chgrp -R gpio /sys/class/gpio
else # >= rhel9
## In rhel9+, ownership is handled by a udev rule.
:
fi

chgrp -R gpio /sys/class/gpio
chgrp -R gpio /sys/devices/platform/imanager/imanager-gpio

exit 0

0 comments on commit d12c101

Please sign in to comment.