Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: install udev rules for UNO Q#240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lucarin91 wants to merge1 commit intoarduino:main
base:main
Choose a base branch
Loading
fromlucarin91:add-post-install-script
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletionspost_install.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

arduino_zephyr_rules () {
cat <<EOF
# Arduino Zephyr rules

# Arduino UNO Q
SUBSYSTEM=="usb", ATTR{idVendor}=="2341", ATTR{idProduct}=="0078", MODE="0666"

EOF
}

OS="$(uname -s)"
case "$OS" in
Linux*)
if [ "$EUID" -ne 0 ]; then
if [ -e "${PWD}/post_install.sh" ]; then
if command -v pkexec > /dev/null 2>&1; then
echo "Requesting root privileges via $PKEXEC..."
pkexec "${PWD}/post_install.sh"
else
echo
echo "You might need to configure permissions for uploading."
echo "To do so, run the following command from the terminal:"
echo "sudo \"${PWD}/post_install.sh\""
echo
exit
fi
else
# Script was executed from another path. It is assumed this will only occur when user is executing script directly.
# So it is not necessary to provide the command line.
echo "Please run as root"
fi

exit
fi

arduino_zephyr_rules > /etc/udev/rules.d/60-arduino-zephyr.rules

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

;;
esac

[8]ページ先頭

©2009-2025 Movatter.jp