Created
October 28, 2024 20:20
-
-
Save max-dark/7f7bdc349251ffee4f4871ddb39871a5 to your computer and use it in GitHub Desktop.
add RW permissions to /dev/gpiochip*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| RULES_TMP_FILE=/tmp/99-gpio-subsystem.rules | |
| # add 'gpio' group | |
| /usr/sbin/addgroup --system gpio | |
| # install udev rules | |
| /usr/bin/echo 'SUBSYSTEM=="gpio", MODE="0660", GROUP="gpio"' > "$RULES_TMP_FILE" | |
| /usr/bin/install --verbose --mode=0644 "$RULES_TMP_FILE" /etc/udev/rules.d/ | |
| # apply changes | |
| /usr/bin/udevadm control --reload | |
| /usr/bin/udevadm trigger | |
| # cleanup | |
| /usr/bin/rm -v "$RULES_TMP_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment