mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 04:31:36 +08:00
setup: only run usermod if $USER is available
This always triggered an error when using in docker as root.
This commit is contained in:
@@ -131,8 +131,10 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
vim-common \
|
||||
;
|
||||
|
||||
# add user to dialout group (serial port access)
|
||||
sudo usermod -a -G dialout $USER
|
||||
if [ ! -z "$USER" ]; then
|
||||
# add user to dialout group (serial port access)
|
||||
sudo usermod -a -G dialout $USER
|
||||
fi
|
||||
|
||||
# Remove modem manager (interferes with PX4 serial port/USB serial usage).
|
||||
sudo apt-get remove modemmanager -y
|
||||
|
||||
Reference in New Issue
Block a user