fix: group dialout is required for klippers USB communication
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -289,17 +289,13 @@ function retrieve_id(){
|
|||||||
fi 2>/dev/null
|
fi 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_usergroup_dialout(){
|
function check_usergroups(){
|
||||||
local group_dialout
|
local group_dialout group_tty
|
||||||
if grep -q "dialout" </etc/group && ! grep -q "dialout" <(groups "${USER}"); then
|
if grep -q "dialout" </etc/group && ! grep -q "dialout" <(groups "${USER}"); then
|
||||||
group_dialout=false
|
group_dialout=false
|
||||||
else
|
|
||||||
group_dialout=true
|
|
||||||
fi
|
fi
|
||||||
if grep -q "tty" </etc/group && ! grep -q "tty" <(groups "${USER}"); then
|
if grep -q "tty" </etc/group && ! grep -q "tty" <(groups "${USER}"); then
|
||||||
group_tty=false
|
group_tty=false
|
||||||
else
|
|
||||||
group_tty=true
|
|
||||||
fi
|
fi
|
||||||
if [ "${group_dialout}" == "false" ] || [ "${group_tty}" == "false" ] ; then
|
if [ "${group_dialout}" == "false" ] || [ "${group_tty}" == "false" ] ; then
|
||||||
top_border
|
top_border
|
||||||
@@ -308,7 +304,8 @@ function check_usergroup_dialout(){
|
|||||||
[ "${group_dialout}" == "false" ] && echo -e "| ${yellow}● dialout${white} |"
|
[ "${group_dialout}" == "false" ] && echo -e "| ${yellow}● dialout${white} |"
|
||||||
blank_line
|
blank_line
|
||||||
echo -e "| It is possible that you won't be able to successfully |"
|
echo -e "| It is possible that you won't be able to successfully |"
|
||||||
echo -e "| flash without your user being a member of that group. |"
|
echo -e "| connect and/or flash the controller board without |"
|
||||||
|
echo -e "| your user being a member of that group. |"
|
||||||
echo -e "| If you want to add the current user to the group(s) |"
|
echo -e "| If you want to add the current user to the group(s) |"
|
||||||
echo -e "| listed above, answer with 'Y'. Else skip with 'n'. |"
|
echo -e "| listed above, answer with 'Y'. Else skip with 'n'. |"
|
||||||
blank_line
|
blank_line
|
||||||
@@ -327,7 +324,8 @@ function check_usergroup_dialout(){
|
|||||||
if [ "${group_dialout}" == "false" ]; then
|
if [ "${group_dialout}" == "false" ]; then
|
||||||
sudo usermod -a -G dialout "${USER}" && ok_msg "Group 'dialout' assigned!"
|
sudo usermod -a -G dialout "${USER}" && ok_msg "Group 'dialout' assigned!"
|
||||||
fi
|
fi
|
||||||
ok_msg "You need to relog/restart for the group(s) to be applied!" && exit 0;;
|
ok_msg "Remember to relog/restart this machine for the group(s) to be applied!"
|
||||||
|
break;;
|
||||||
N|n|No|no)
|
N|n|No|no)
|
||||||
select_msg "No"
|
select_msg "No"
|
||||||
break;;
|
break;;
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ function klipper_setup(){
|
|||||||
do_action_service "enable" "klipper"
|
do_action_service "enable" "klipper"
|
||||||
do_action_service "start" "klipper"
|
do_action_service "start" "klipper"
|
||||||
|
|
||||||
|
### step 6: check for dialout group membership
|
||||||
|
check_usergroups
|
||||||
|
|
||||||
### confirm message
|
### confirm message
|
||||||
if [[ ${instances} -eq 1 ]]; then
|
if [[ ${instances} -eq 1 ]]; then
|
||||||
local confirm="Klipper has been set up!"
|
local confirm="Klipper has been set up!"
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ advanced_menu(){
|
|||||||
do_action "build_fw" "advanced_ui";;
|
do_action "build_fw" "advanced_ui";;
|
||||||
4)
|
4)
|
||||||
clear && print_header
|
clear && print_header
|
||||||
check_usergroup_dialout
|
check_usergroups
|
||||||
do_action "select_flash_method" "advanced_ui";;
|
do_action "select_flash_method" "advanced_ui";;
|
||||||
5)
|
5)
|
||||||
clear && print_header
|
clear && print_header
|
||||||
check_usergroup_dialout
|
check_usergroups
|
||||||
status_msg "Please wait..."
|
status_msg "Please wait..."
|
||||||
build_fw && select_flash_method
|
build_fw && select_flash_method
|
||||||
print_msg && clear_msg
|
print_msg && clear_msg
|
||||||
|
|||||||
Reference in New Issue
Block a user