Skip to content

Commit

Permalink
[FIRSTBOOT] fix shell error at L209 + rm prompts pre loop
Browse files Browse the repository at this point in the history
- shellcheck L209: test_video-2_func()
^-- SC3033 (warning): In POSIX sh, naming functions outside [a-zA-Z_][a-zA-Z0-9_]* is undefined.
- don't call prompts dialog before while loops (doubling)
  • Loading branch information
Apaczer committed Aug 21, 2023
1 parent 0d71104 commit a4d3213
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions board/miyoo/boot/firstboot
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ test_video_func(){
fi
}

test_video-2_func(){
test_video2_func(){
dialog --defaultno --ok-label NO --cancel-label YES --stdout --title " Test Video'2" \
--colors --pause "\n\n \ZuCan you see this message?\Zn\n\nSelect an option & press START" 12 34 10

Expand Down Expand Up @@ -310,10 +310,8 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
if (grep -q "$DETECTED_1" "${MOUNTDIR}/uEnv.txt"); then
dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_1" 0 0
# Test_Video-prompt if proper miyoo video's version driver was loaded:
test_video_func

# Loop Test_Video until correct selection has been performed (CHOICE=0/3)
## former CHOICE=1 meant safe_reboot if correct and shouldn't reach to this point
## Loop Test_Video until correct selection has been performed (CHOICE=0/3)
### former CHOICE=1 meant safe_reboot if correct and shouldn't reach to this point
while true; do
test_video_func
if !(test $CHOICE -eq -1 || test $CHOICE -eq 1 || test $CHOICE -eq 255); then
Expand Down Expand Up @@ -404,9 +402,8 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
elif (grep -q "$DETECTED_2" "${MOUNTDIR}/uEnv.txt"); then
dialog --timeout 4 --msgbox "Correcting $DETECTED_2 - wait for further instructions" 0 0
fi
## Test_Keyboard-prompt if proper miyoo.kbd version was loaded:
test_keyboard_func
# Loop Test_Keyboard until correct selection has been performed (CHOICE=0/1)
# Test_Keyboard-prompt if proper miyoo.kbd version was loaded:
## Loop Test_Keyboard until correct selection has been performed (CHOICE=0/1)
while true; do
test_keyboard_func
if !(test $CHOICE -eq -1 || test $CHOICE -eq 255); then
Expand All @@ -416,7 +413,7 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
elif (test "$CONSOLE_VARIANT" == "bittboy" && grep -q "$DETECTED_4" "${MOUNTDIR}/uEnv.txt") ; then
dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_4" 0 0
# Test_Video'2-prompt if proper miyoo video's version driver was loaded:
test_video-2_func
test_video2_func
fi
fi

Expand Down

0 comments on commit a4d3213

Please sign in to comment.