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
9d953b5b
Commit
9d953b5b
authored
Sep 01, 2018
by
Igor Pecovnik
Browse files
Alternative kernel switching - descriptions in more human friendly format
parent
398c0b01
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
9d953b5b
...
...
@@ -285,6 +285,19 @@ function description
#
# kernel descriptions in more human friendly format
#
function
kernel_desc
()
{
[[
"
$1
"
==
"dev"
]]
&&
echo
"development, unstable"
[[
"
$1
"
==
"next"
]]
&&
echo
"mainline or 2nd generation"
[[
"
$1
"
==
"default"
]]
&&
echo
"legacy, stock, 1st build"
}
#
# check if board has alternative kernels
#
...
...
@@ -298,7 +311,9 @@ function aval_kernel ()
local
LIST
=()
for
i
in
"
${
AVAL_KERNEL
[@]
}
"
do
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
""
)
VALUE
=
"
${
i
[0]//[[
:blank:]]/
}
"
DESC
=
$(
kernel_desc
$VALUE
)
LIST+
=(
"
$VALUE
"
"
$DESC
"
)
done
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
if
[
"
$LIST_LENGHT
"
-eq
0
]
;
then
...
...
@@ -309,7 +324,7 @@ function aval_kernel ()
if
[[
-n
$ACKNOWLEDGEMENT
]]
;
then
exec
3>&1
TARGET_BRANCH
=
$(
dialog
--cancel-label
"Cancel"
--backtitle
"
$BACKTITLE
"
--no-collapse
\
--title
"
Upgrade from
$BRANCH
to:"
--clear
--menu
"
"
$((
6
+
${
LIST_LENGHT
}))
4
0
1
5
"
${
LIST
[@]
}
"
2>&1 1>&3
)
--title
"
Switch to alternative kernels"
--clear
--menu
"
\n
Switch from
$(
kernel_desc
$BRANCH
)
to:
\n
\n
"
$((
9
+
${
LIST_LENGHT
}))
6
0
2
5
"
${
LIST
[@]
}
"
2>&1 1>&3
)
exitstatus
=
$?
;
exec
3>&-
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