diff --git a/Arch-Linux/LCD35-show b/Arch-Linux/LCD35-show index 33f4127..50312c6 100755 --- a/Arch-Linux/LCD35-show +++ b/Arch-Linux/LCD35-show @@ -3,6 +3,9 @@ # Change working directory up to the main directory to allow easier access to the boot, etc, and usr directories. cd .. +# Install wget... +sudo pacman -Sy --needed --noconfirm wget + sudo ./system_backup.sh if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then @@ -46,7 +49,7 @@ echo "gpio:resistance:35:90:480:320" > ./.have_installed #FBCP install wget --spider -q -o /dev/null --tries=1 -T 10 https://cmake.org/ if [ $? -eq 0 ]; then - sudo pacman -Sy --needed --noconfirm cmake 2> error_output.txt + sudo pacman -Sy --needed --noconfirm cmake make 2> error_output.txt result=`cat ./error_output.txt` echo -e "\033[31m$result\033[0m" grep -q "^E:" ./error_output.txt @@ -66,14 +69,14 @@ if [ $? -eq 0 ]; then fi sudo mkdir ./rpi-fbcp/build cd ./rpi-fbcp/build/ - sudo cmake .. - sudo make + cmake .. + make sudo install fbcp /usr/local/bin/fbcp cd - > /dev/null type fbcp > /dev/null 2>&1 if [ $? -eq 0 ]; then sudo cp -rf ./Arch-Linux/usr/99-fbdev-fbcp.conf /usr/share/X11/xorg.conf.d/99-fbdev.conf - sudo cp -rf ./etc/rc.local /etc/rc.local + #sudo cp -rf ./etc/rc.local /etc/rc.local fi else echo "install cmake error!!!!" diff --git a/Arch-Linux/rotate.sh b/Arch-Linux/rotate.sh index 13b31c6..a5cf2d6 100755 --- a/Arch-Linux/rotate.sh +++ b/Arch-Linux/rotate.sh @@ -1,6 +1,6 @@ #!/bin/bash cur_dir=`pwd` -if [ ! -f $cur_dir/.have_installed ]; then +if [ ! -f $cur_dir/../.have_installed ]; then echo "Please install the LCD driver first" echo "Usage: sudo ./xxx-show. xxx: MHS35,LCD35,MPI3508 etc." exit @@ -39,13 +39,13 @@ exit fi #get screen parameter -tmp=`cat $cur_dir/.have_installed` -output_type=`cat $cur_dir/.have_installed | awk -F ':' '{printf $1}'` -touch_type=`cat $cur_dir/.have_installed | awk -F ':' '{printf $2}'` -device_id=`cat $cur_dir/.have_installed | awk -F ':' '{printf $3}'` -default_value=`cat $cur_dir/.have_installed | awk -F ':' '{printf $4}'` -width=`cat $cur_dir/.have_installed | awk -F ':' '{printf $5}'` -height=`cat $cur_dir/.have_installed | awk -F ':' '{printf $6}'` +tmp=`cat $cur_dir/../.have_installed` +output_type=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $1}'` +touch_type=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $2}'` +device_id=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $3}'` +default_value=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $4}'` +width=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $5}'` +height=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $6}'` if [ $output_type = "hdmi" ]; then result=`grep -rn "^display_rotate=" /boot/config.txt | tail -n 1` diff --git a/Arch-Linux/usr/99-calibration.conf-35-0 b/Arch-Linux/usr/99-calibration.conf-35-0 new file mode 100755 index 0000000..30b06d6 --- /dev/null +++ b/Arch-Linux/usr/99-calibration.conf-35-0 @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "268 3880 227 3936" + Option "SwapAxes" "0" +EndSection diff --git a/Arch-Linux/usr/99-calibration.conf-35-180 b/Arch-Linux/usr/99-calibration.conf-35-180 new file mode 100755 index 0000000..99ad398 --- /dev/null +++ b/Arch-Linux/usr/99-calibration.conf-35-180 @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "3880 268 3936 227" + Option "SwapAxes" "0" +EndSection diff --git a/Arch-Linux/usr/99-calibration.conf-35-270 b/Arch-Linux/usr/99-calibration.conf-35-270 new file mode 100755 index 0000000..90f3c37 --- /dev/null +++ b/Arch-Linux/usr/99-calibration.conf-35-270 @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "227 3936 3880 268" + Option "SwapAxes" "1" +EndSection diff --git a/Arch-Linux/usr/99-calibration.conf-35-90 b/Arch-Linux/usr/99-calibration.conf-35-90 new file mode 100755 index 0000000..7f85eb0 --- /dev/null +++ b/Arch-Linux/usr/99-calibration.conf-35-90 @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "3936 227 268 3880" + Option "SwapAxes" "1" +EndSection diff --git a/system_backup.sh b/system_backup.sh index 3cd2be1..085c06f 100755 --- a/system_backup.sh +++ b/system_backup.sh @@ -50,11 +50,15 @@ if [ -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]; then sudo cp -rf /usr/share/X11/xorg.conf.d/99-fbturbo.conf ./.system_backup/ fi #sudo cp -rf ./usr/99-fbturbo.conf-original /usr/share/X11/xorg.conf.d/99-fbturbo.conf +if [ -f /etc/rc.local ]; then sudo cp -rf /etc/rc.local ./.system_backup/ #sudo cp -rf ./etc/rc.local-original /etc/rc.local +fi +if [ -f /etc/modules ]; then sudo cp -rf /etc/modules ./.system_backup/ #sudo cp -rf ./etc/modules-original /etc/modules +fi if [ -f /etc/modprobe.d/fbtft.conf ]; then sudo cp -rf /etc/modprobe.d/fbtft.conf ./.system_backup diff --git a/system_restore.sh b/system_restore.sh index 6485579..128b907 100755 --- a/system_restore.sh +++ b/system_restore.sh @@ -39,8 +39,14 @@ sudo cp -rf ./.system_backup/99-fbturbo.conf /usr/share/X11/xorg.conf.d fi sudo cp -rf ./.system_backup/cmdline.txt /boot/ sudo cp -rf ./.system_backup/config.txt /boot/ + +if [ -f ./.system_backup/rc.local ]; then sudo cp -rf ./.system_backup/rc.local /etc/ +fi + +if [ -f ./.system_backup/modules ]; then sudo cp -rf ./.system_backup/modules /etc/ +fi if [ -f /etc/inittab ]; then sudo rm -rf /etc/inittab