forked from waveshareteam/LCD-show
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LCD35C-show
executable file
·112 lines (101 loc) · 3.98 KB
/
LCD35C-show
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
i=1
for lines in `cat ./boot/mark`
do
case ${i} in
1) var1=${lines};;
esac
i=`expr ${i} + 1`
done
#echo "$var1"
j=$(uname -n)
if test "$var1" = "0" -a "$1" != "lite" -a "$2" != "lite";then
if test "$j" != "retropie" ;then
sudo apt-get install xserver-xorg-input-evdev
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
fi
if test "$j" = "retropie" ;then
sudo cp -rf ./nes /home/pi/RetroPie/roms/
fi
echo "1" > ./boot/mark
sudo apt-get install cmake -y
cd ./rpi-fbcp/build/
sudo cmake ..
sudo make
sudo install fbcp /usr/local/bin/fbcp
cd ../../
sudo dpkg -i -B ./xinput-calibrator_0.7.5-1_armhf.deb
sudo mkdir -p /usr/share/X11/xorg.conf.d
elif test "$var1" = "0" -a "$1" = "lite" ;then
echo "1" > ./boot/mark
echo "No touch driver installled"
echo "No fbcp driver installled"
sudo mkdir -p /usr/share/X11/xorg.conf.d
fi
if test "$j" != "kali" ;then
if test "$1" != "lite" -a "$2" != "lite" ;then
sudo cp -rf ./etc/rc.local-gpio /etc/rc.local
sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf
else
sudo cp -rf ./etc/rc.local /etc/rc.local
sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.conf
fi
else
sudo cp ./usr/share/X11/xorg.conf.d/99-fbturbo.conf-kali /usr/share/X11/xorg.conf.d/99-fbturbo.conf
fi
if test "$1" = "0" -o "$#" = "0" -o "$2" = "0";then
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c /usr/share/X11/xorg.conf.d/99-calibration.conf
if test "$1" = "lite" -o "$2" = "lite" -o "$j" = "kali"; then
sudo cp ./boot/config-35c.txt-lite /boot/config.txt
else
sudo cp ./boot/config-35c.txt /boot/config.txt
fi
if test "$j" = "retropie"; then
sudo cp ./boot/config-35c.txt-retropie /boot/config.txt
fi
echo "LCD configure 0"
elif test "$1" = "lite" -a "$#" = "1" ;then
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c /usr/share/X11/xorg.conf.d/99-calibration.conf
sudo cp ./boot/config-35c.txt-lite /boot/config.txt
echo "LCD configure 0"
elif test "$1" = "90" -o "$2" = "90" ;then
if test "$1" = "lite" -o "$2" = "lite" -o "$j" = "kali"; then
sudo cp ./boot/config-35c.txt-90-lite /boot/config.txt
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c-270 /usr/share/X11/xorg.conf.d/99-calibration.conf
else
sudo cp ./boot/config-35c.txt-90 /boot/config.txt
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c-90 /usr/share/X11/xorg.conf.d/99-calibration.conf
fi
echo "LCD configure 90"
elif test "$1" = "180" -o "$2" = "180" ;then
if test "$1" = "lite" -o "$2" = "lite" -o "$j" = "kali"; then
sudo cp ./boot/config-35c.txt-180-lite /boot/config.txt
else
sudo cp ./boot/config-35c.txt-180 /boot/config.txt
fi
echo "LCD configure 180"
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c-180 /usr/share/X11/xorg.conf.d/99-calibration.conf
elif test "$1" = "270" -o "$2" = "270" ; then
if test "$1" = "lite" -o "$2" = "lite" -o "$j" = "kali"; then
sudo cp ./boot/config-35c.txt-270-lite /boot/config.txt
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c-90 /usr/share/X11/xorg.conf.d/99-calibration.conf
else
sudo cp ./boot/config-35c.txt-270 /boot/config.txt
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35c-270 /usr/share/X11/xorg.conf.d/99-calibration.conf
fi
echo "LCD configure 270"
fi
sudo cp ./waveshare35c-overlay.dtb /boot/overlays/waveshare35c.dtbo
sudo cp ./waveshare35c-overlay.dtb /boot/overlays/
#sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
if [ -b /dev/mmcblk0p7 ]; then
sudo cp ./cmdline.txt-noobs /boot/cmdline.txt
else
sudo cp ./cmdline.txt /boot/
fi
sudo cp ./inittab /etc/
if test "$#" = "0" -o "$1" = "0" -o "$1" = "90" -o "$1" = "180" -o "$1" = "270" -o "$2" = "0" -o "$2" = "90" -o "$2" = "180" -o "$2" = "270" -o "$1" = "lite" -o "$2" = "lite" ; then
sudo reboot
echo "reboot now"
else
echo "Invalid parameter,Usage:LCD35C-show [0] [90] [180] [270] [lite]"
fi