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

Commitdaea2f1

Browse files
authored
Display useful message when Linux post-install script has insufficient permissions
The Arduino Boards Manager automatically executes the `post_install.sh` script during installation of the platform on aLinux machine.This platform's post-install script is intended to create a udev rules file that gives write permissions for the USBdevices of the platform's boards. These permissions are required in order to upload to the boards.The creation of the udev rules file requires superuser privileges, which are typically not available in the context ofthe post-install script's execution. The script contains code to check whether the necessary privileges are available.If not, it prints a message and skips the udev rules file creation.Previously the message printed when the udev rules file creation was not possible was "Please run as root". This messagewas completely meaningless to the user when printed during the Boards Manager installation. Worse, it might cause themto think they must run the Arduino development software as root user, which is a bad idea and also wouldn't result inthe udev rules file being created since the installation of the platform to the user's account was already completed.The message is hereby updated to provide a meaningful explanation of the potential problem as well as the specificcommand the user can run from the terminal to execute the script as superuser.
1 parent6293cea commitdaea2f1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎post_install.sh‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", MODE:="0666"
1212
EOF
1313
}
1414

15-
if ["$EUID"-ne 0 ]
16-
thenecho"Please run as root"
15+
if ["$EUID"-ne 0 ];then
16+
if [-e"${PWD}/post_install.sh" ];then
17+
echo
18+
echo"You might need to configure permissions for uploading."
19+
echo"To do so, run the following command from the terminal:"
20+
echo"sudo\"${PWD}/post_install.sh\""
21+
echo
22+
else
23+
# Script was executed from another path. It is assumed this will only occur when user is executing script directly.
24+
# So it is not necessary to provide the command line.
25+
echo"Please run as root"
26+
fi
27+
1728
exit
1829
fi
1930

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp