Commit a4e51344 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Add warning before changing to alternative kernels

parent 73aaae53
...@@ -80,7 +80,7 @@ function beta_disclaimer () ...@@ -80,7 +80,7 @@ function beta_disclaimer ()
{ {
exec 3>&1 exec 3>&1
ACKNOWLEDGEMENT=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse --title " Warning " \ ACKNOWLEDGEMENT=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse --title " Warning " \
--clear \--radiolist "\n$1.\n \n" 12 56 7 "Yes, I understand" "" off 2>&1 1>&3) --clear \--radiolist "\n$1\n \n" 11 56 5 "Yes, I understand" "" off 2>&1 1>&3)
exec 3>&- exec 3>&-
} }
...@@ -156,13 +156,17 @@ function aval_kernel () ...@@ -156,13 +156,17 @@ function aval_kernel ()
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGHT=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGHT" -eq 1 ]; then
TARGET_BRANCH=${AVAL_KERNEL[0]} TARGET_BRANCH=${AVAL_KERNEL[0]}
dialog --backtitle "$BACKTITLE" --title " Info " --msgbox "\nNo alternative kernels available!" 7 38
else else
beta_disclaimer "Switching between kernels might change functionality of your board or it might fail to boot."
if [[ -n $ACKNOWLEDGEMENT ]]; then
exec 3>&1 exec 3>&1
TARGET_BRANCH=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \ TARGET_BRANCH=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
--title "Upgrade from $BRANCH to:" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3) --title "Upgrade from $BRANCH to:" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?; exitstatus=$?;
exec 3>&- exec 3>&-
fi fi
fi
} }
......
...@@ -1162,8 +1162,6 @@ function jobs () ...@@ -1162,8 +1162,6 @@ function jobs ()
exitstatus=$?; exitstatus=$?;
[[ $exitstatus = 0 ]] && reboot [[ $exitstatus = 0 ]] && reboot
fi fi
else
dialog --backtitle "$BACKTITLE" --title " Info " --msgbox "\nNo alternative kernels available!" 7 38
fi fi
fi fi
;; ;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment