Skip to content

Commit

Permalink
Merge pull request #129 from seaxwi/post-install.sh
Browse files Browse the repository at this point in the history
New post_install.sh script that works for Nano Every
  • Loading branch information
facchinm committed May 31, 2023
2 parents ffab9cb + aa477bb commit 5e639ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
28 changes: 28 additions & 0 deletions post_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

megaAVR_rules () {
echo ""
echo "# Arduino Mega AVR boards bootloader mode udev rules"
echo ""
cat <<EOF
# Arduino UNO WiFi Rev2
SUBSYSTEMS=="tty", ENV{ID_REVISION}=="03eb", ENV{ID_MODEL_ID}=="2145", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_CANDIDATE}="0"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2145", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
# Arduino Nano Every
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0058", MODE:="0666"
EOF
}

if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi

megaAVR_rules > /etc/udev/rules.d/60-arduino-megaAVR.rules

# reload udev rules
echo "Reload rules..."
udevadm control --reload-rules
udevadm trigger

17 changes: 0 additions & 17 deletions scripts/create_dfu_udev_rule

This file was deleted.

0 comments on commit 5e639ee

Please sign in to comment.