Skip to content

Instantly share code, notes, and snippets.

@max-dark
Created October 28, 2024 20:20
Show Gist options
  • Save max-dark/7f7bdc349251ffee4f4871ddb39871a5 to your computer and use it in GitHub Desktop.
Save max-dark/7f7bdc349251ffee4f4871ddb39871a5 to your computer and use it in GitHub Desktop.
add RW permissions to /dev/gpiochip*
#!/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