Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
a4e51344
Commit
a4e51344
authored
Apr 17, 2018
by
Igor Pecovnik
Browse files
Add warning before changing to alternative kernels
parent
73aaae53
Changes
2
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
100644 → 100755
View file @
a4e51344
...
@@ -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
"
1
2
56
7
"Yes, I understand"
""
off 2>&1 1>&3
)
--clear
\-
-radiolist
"
\n
$1
\n
\n
"
1
1
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
"
\n
No 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
}
}
...
...
debian-config-jobs
100644 → 100755
View file @
a4e51344
...
@@ -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
\
"
\n
Switching to
\Z
1linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\Z
0
\n\n
Warning: another kernel might not provide
\
"
\n
Switching to
\Z
1linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\Z
0
\n\n
Warning: 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
"
\n
No alternative kernels available!"
7 38
fi
fi
fi
fi
;;
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment