File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ arduino_zephyr_rules () {
4+ cat << EOF
5+ # Arduino Zephyr rules
6+
7+ # Arduino UNO Q
8+ SUBSYSTEM=="usb", ATTR{idVendor}=="2341", ATTR{idProduct}=="0078", MODE="0666"
9+
10+ EOF
11+ }
12+
13+ OS=" $( uname -s) "
14+ case " $OS " in
15+ Linux* )
16+ if [ " $EUID " -ne 0 ]; then
17+ if [ -e " ${PWD} /post_install.sh" ]; then
18+ if command -v pkexec > /dev/null 2>&1 ; then
19+ echo " Requesting root privileges via $PKEXEC ..."
20+ pkexec " ${PWD} /post_install.sh"
21+ else
22+ echo
23+ echo " You might need to configure permissions for uploading."
24+ echo " To do so, run the following command from the terminal:"
25+ echo " sudo \" ${PWD} /post_install.sh\" "
26+ echo
27+ exit
28+ fi
29+ else
30+ # Script was executed from another path. It is assumed this will only occur when user is executing script directly.
31+ # So it is not necessary to provide the command line.
32+ echo " Please run as root"
33+ fi
34+
35+ exit
36+ fi
37+
38+ arduino_zephyr_rules > /etc/udev/rules.d/60-arduino-zephyr.rules
39+
40+ # reload udev rules
41+ echo " Reload rules..."
42+ udevadm trigger
43+ udevadm control --reload-rules
44+
45+ ;;
46+ esac
You can’t perform that action at this time.
0 commit comments