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,12 +156,16 @@ function aval_kernel () ...@@ -156,12 +156,16 @@ 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
exec 3>&1 beta_disclaimer "Switching between kernels might change functionality of your board or it might fail to boot."
TARGET_BRANCH=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \ if [[ -n $ACKNOWLEDGEMENT ]]; then
--title "Upgrade from $BRANCH to:" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3) exec 3>&1
exitstatus=$?; TARGET_BRANCH=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
exec 3>&- --title "Upgrade from $BRANCH to:" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?;
exec 3>&-
fi
fi fi
} }
......
...@@ -1126,7 +1126,7 @@ function jobs () ...@@ -1126,7 +1126,7 @@ function jobs ()
"Switch" ) "Switch" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
aval_kernel aval_kernel
if [[ -n $TARGET_BRANCH ]]; then if [[ -n $TARGET_BRANCH ]]; then
exceptions "$INSTALL_KERNEL" exceptions "$INSTALL_KERNEL"
dialog --title " Install and reboot " --colors --backtitle "$BACKTITLE" --yes-label "OK" --no-label "Cancel" --yesno \ dialog --title " Install and reboot " --colors --backtitle "$BACKTITLE" --yes-label "OK" --no-label "Cancel" --yesno \
"\nSwitching to \Z1linux-image${TARGET_BRANCH}-${TARGET_FAMILY}\Z0 \n\nWarning: another kernel might not provide\ "\nSwitching to \Z1linux-image${TARGET_BRANCH}-${TARGET_FAMILY}\Z0 \n\nWarning: another kernel might not provide\
...@@ -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