-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdispinfo.sh
executable file
·144 lines (133 loc) · 4.75 KB
/
dispinfo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)
#
# Collect CoreELEC display information
#
#####################################################
#
# Comand Line Arguments
# -l = Show local only
# -r = Remove items that are redundant between debug scripts, and show local only
#
#####################################################
OUTPUTFILE="/storage/dispinfo.txt"
fancycat()
{
# $1 = file $2 = message if file not found
printf "------------ $1 ------------" >> $OUTPUTFILE
if [ -f $1 ]; then
printf "\n" >> $OUTPUTFILE
cat $1 | tr '\000' '\n' >> $OUTPUTFILE
else
printf " $2\n" >> $OUTPUTFILE
fi
}
fancychk()
{
printf "------------ $1 ------------" >> $OUTPUTFILE
if [ -f $1 ]; then
printf " Set by user!\n" >> $OUTPUTFILE
else
printf " Unset by user!\n" >> $OUTPUTFILE
fi
}
fancycatdir()
{
# $1 = directory $2 = filename pattern $3 = message if file not found
printf "------------ $1 ------------" >> $OUTPUTFILE
if [ -d $1 ]; then
printf "\n" >> $OUTPUTFILE
for filename in $1/$2
do
[ -e $filename ] || continue
if [ -f $filename ]; then
fancycat $filename $3
fi
done
else
printf " Directory Not Found!\n"
fi
}
wildcat()
{
# $1 = filename pattern $2 = message if file not found
printf "------------ $1 ------------" >> $OUTPUTFILE
if [ -e $1 ]; then
printf "\n" >> $OUTPUTFILE
for filename in $1
do
[ -e $filename ] || continue
if [ -f $filename ]; then
fancycat $filename $2
fi
done
else
printf " $2\n" >> $OUTPUTFILE
fi
}
printf "CoreELEC Display Information...\n\n" > $OUTPUTFILE
if [ "$1" != "-r" ]; then
fancycat "/etc/os-release" "Not Found!"
fancycat "/proc/device-tree/coreelec-dt-id" "Not Found!"
fancycat "/proc/device-tree/le-dt-id" "Not Found!"
fancycat "/proc/cmdline" "Not Found!"
fi
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/edid" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/edid_parsing" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/rawedid" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/config" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/dc_cap" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/dv_cap" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/attr" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/disp_cap" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/vesa_cap" "Not Found!"
fancychk "/flash/vesa.enable"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/custom_mode" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/preferred_mode" "Not Found!"
fancycat "/sys/devices/virtual/amhdmitx/amhdmitx0/hdr_cap" "Not Found!"
fancycat "/sys/module/am_vecm/parameters/hdr_mode" "Not Found!"
fancycat "/sys/module/am_vecm/parameters/sdr_mode" "Not Found!"
fancycat "/sys/module/am_vecm/parameters/video_process_status" "Not Found!"
fancycat "/sys/module/am_vecm/parameters/hdr_policy" "Not Found!"
fancycat "/sys/class/display/vinfo" "Not Found!"
printf "------------ kodi display settings ------------" >> $OUTPUTFILE
if [ -f /storage/.kodi/userdata/guisettings.xml ]; then
printf "\n" >> $OUTPUTFILE
for tag in "coreelec.amlogic.limit8bit" \
"coreelec.amlogic.force422" \
"coreelec.amlogic.deinterlacing" \
"coreelec.amlogic.noisereduction" \
"coreelec.amlogic.hdr2sdr" \
"coreelec.amlogic.sdr2hdr" \
"videoplayer.adjustrefreshrate" \
"videoplayer.useamcodec" \
"videoplayer.useamcodech264" \
"videoplayer.useamcodecmpeg2" \
"videoplayer.useamcodecmpeg4" \
"videoplayer.usedisplayasclock" \
"videoscreen.whitelist" \
"lookandfeel.skin"
do
printf "$tag: " >> $OUTPUTFILE
value=$(cat /storage/.kodi/userdata/guisettings.xml |grep "\"$tag\"" |grep -o '>.*<' |sed -E 's/[<>]//g')
[ -n "$value" ] && printf "$value" >> $OUTPUTFILE
printf "\n" >> $OUTPUTFILE
done
else
printf " Not Found!\n" >> $OUTPUTFILE
fi
fancycat "/storage/.kodi/userdata/disp_cap" "Unset by user!"
fancycat "/storage/.kodi/userdata/disp_add" "Unset by user!"
fancycat "/flash/resolution.ini" "Not Found!"
if [ "$1" != "-r" ]; then
fancycat "/flash/boot.ini" "Not Found!"
fancycat "/flash/config.ini" "Not Found!"
fancycat "/storage/.config/autostart.sh" "Unset by user!"
fi
if [ "$1" = "-l" ] || [ "$1" = "-r" ]; then
cat $OUTPUTFILE
else
paste $OUTPUTFILE
fi