Commit 0df799ee authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Added Odroid C2 video mode switching

parent c38ad64d
...@@ -382,6 +382,37 @@ function get_a20modes () ...@@ -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 # select video modes for h3
# #
...@@ -412,6 +443,7 @@ function get_h3modes () ...@@ -412,6 +443,7 @@ function get_h3modes ()
# #
# create or pick unprivileged user # create or pick unprivileged user
# #
......
...@@ -192,6 +192,9 @@ function jobs () ...@@ -192,6 +192,9 @@ function jobs ()
fi 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 else
# a20 boards # a20 boards
get_a20modes get_a20modes
......
...@@ -74,7 +74,7 @@ while true; do ...@@ -74,7 +74,7 @@ while true; do
LIST+=( "Firmware" "Run apt update & apt upgrade" ) LIST+=( "Firmware" "Run apt update & apt upgrade" )
[[ "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" && \ [[ "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" && \
-n $(bin2fex </boot/script.bin 2>/dev/null | grep -w "hdmi_used = 1") ]] && LIST+=( "Display" "set the display resolution" ) -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 # desktop
if [[ -n $DISPLAY_MANAGER ]]; then if [[ -n $DISPLAY_MANAGER ]]; then
LIST+=( "Desktop" "Disable desktop" ) LIST+=( "Desktop" "Disable desktop" )
...@@ -372,4 +372,4 @@ while true; do ...@@ -372,4 +372,4 @@ while true; do
jobs "$selection" jobs "$selection"
done done
} }
\ No newline at end of file
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