Created
March 4, 2013 19:39
-
-
Save Starefossen/5084860 to your computer and use it in GitHub Desktop.
The 'RUN' directive is necessary to set /dev/bus/usb/PORT/ADDRESS permissions along with /dev/usb_endpointPORT.ADDRESS_epNN
The script is as follows http://www.segger2.com/index.php?page=Thread&threadID=103
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
BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_endpoint", GOTO="kcontrol_rules_end" | |
SUBSYSTEM=="usb_endpoint", ATTRS{idProduct}=="0101", ATTRS{idVendor}=="1366", MODE="0666", GROUP="usbusergroup", RUN+="/usr/local/bin/chk_jlink" | |
LABEL="kcontrol_rules_end" |
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/bash | |
GROUP="usbusergroup" | |
# Get the bus directory | |
BUS_DIR=`echo $DEVNAME | sed -e "s|/dev/usbdev\([0-9]*\).\([0-9]*\)_.*|\1 \2|" | awk '{printf "%03d/%03d",$1,$2}'` | |
FULL_PATH=/dev/bus/usb/$BUS_DIR | |
# Set permissions for FULL_PATH | |
chgrp -f --preserve-root $GROUP $FULL_PATH | |
chmod 0664 $FULL_PATH | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment