Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(files/imanager-init) handle rhel9+, with no /sys/class/gpio #25

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading