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
0df799ee
Commit
0df799ee
authored
Jun 22, 2018
by
Igor Pecovnik
Browse files
Added Odroid C2 video mode switching
parent
c38ad64d
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
0df799ee
...
...
@@ -382,6 +382,37 @@ function get_a20modes ()
#
# select video modes for odroid c1/c2
#
function
get_odroidmodes
()
{
IFS
=
$'
\r\n
'
GLOBIGNORE
=
'*'
SCREEN_RESOLUTION
=(
$(
cat
/boot/boot.ini |
grep
-w
"# setenv"
|
grep
"hz"
|
cut
-d
'"'
-f
2
)
)
local
LIST
=()
for
i
in
"
${
SCREEN_RESOLUTION
[@]
}
"
do
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
""
)
done
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
#echo $LIST_LENGHT
#exit
if
[
"
$LIST_LENGHT
"
-eq
1
]
;
then
SCREEN_RESOLUTION
=
${
SCREEN_RESOLUTION
[0]
}
else
exec
3>&1
SCREEN_RESOLUTION
=
$(
dialog
--nocancel
--backtitle
"
$BACKTITLE
"
--no-collapse
\
--title
"Select video mode"
--clear
--menu
""
$((
6
+
${
LIST_LENGHT
}))
25
$((
1
+
${
LIST_LENGHT
}))
"
${
LIST
[@]
}
"
2>&1 1>&3
)
exec
3>&-
fi
}
#
# select video modes for h3
#
...
...
@@ -412,6 +443,7 @@ function get_h3modes ()
#
# create or pick unprivileged user
#
...
...
debian-config-jobs
View file @
0df799ee
...
...
@@ -192,6 +192,9 @@ function jobs ()
fi
elif
[[
"
$LINUXFAMILY
"
=
odroidc
*
]]
;
then
get_odroidmodes
display_cmd
=
"sed -i
\"
s/^setenv m .*/# &/
\"
/boot/boot.ini;sed -i '/setenv m
\"
$SCREEN_RESOLUTION
\"
/s/^# //g' /boot/boot.ini"
;
else
# a20 boards
get_a20modes
...
...
debian-config-submenu
View file @
0df799ee
...
...
@@ -74,7 +74,7 @@ while true; do
LIST+
=(
"Firmware"
"Run apt update & apt upgrade"
)
[[
"
$LINUXFAMILY
"
=
sun
*
i
&&
"
$BRANCH
"
=
"default"
&&
\
-n
$(
bin2fex </boot/script.bin 2>/dev/null |
grep
-w
"hdmi_used = 1"
)
]]
&&
LIST+
=(
"Display"
"set the display resolution"
)
[[
"
$LINUXFAMILY
"
=
odroidc
*
&&
"
$BRANCH
"
=
"default"
]]
&&
LIST+
=(
"Display"
"set the display resolution"
)
# desktop
if
[[
-n
$DISPLAY_MANAGER
]]
;
then
LIST+
=(
"Desktop"
"Disable desktop"
)
...
...
@@ -372,4 +372,4 @@ while true; do
jobs
"
$selection
"
done
}
\ No newline at end of file
}
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