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