Guest User

LCD35-show for Raspbian 9.8 Stretch

a guest
Apr 12th, 2019
677
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.55 KB | None | 1 0
  1. #!/bin/bash
  2. # This is a modified "LCD35-show" script to replace the one in https://github.com/goodtft/LCD-show. Use this script for Raspbian 9.8 Stretch. Might not work with older or newer versions of Raspbian!
  3.  
  4. sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
  5. sudo mkdir  /etc/X11/xorg.conf.d
  6.  
  7. sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
  8. sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
  9.  
  10. # Michel: these two file have to be removed again when you want to switch back to HDMI:
  11. sudo cp -rf ./usr/99-calibration.conf-35  /etc/X11/xorg.conf.d/99-calibration.conf
  12. sudo cp -rf ./usr/99-fbturbo.conf         /usr/share/X11/xorg.conf.d/
  13.  
  14. if [ -b /dev/mmcblk0p7 ]
  15.    then
  16.       sudo cp ./usr/cmdline.txt-noobs /boot/cmdline.txt
  17.    else
  18.       sudo cp ./usr/cmdline.txt /boot/
  19. fi
  20.  
  21. sudo cp ./usr/inittab /etc/
  22.  
  23. sudo cp ./boot/config-35.txt /boot/config.txt
  24.  
  25. nodeplatform=`uname -n`
  26. # kernel=`uname -r`
  27. version=`uname -v`
  28.  
  29. if test "$nodeplatform" = "raspberrypi"
  30.    then
  31.       echo "this is raspberrypi kernel"
  32.       version=${version%% *}
  33.       version=${version#*#}
  34.       echo $version
  35.       if test $version -lt 970
  36.          then
  37.             echo "reboot"
  38.          else
  39.             echo "need to update touch configuration"
  40.             sudo apt-get install xserver-xorg-input-evdev
  41.             sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
  42.             echo "reboot"
  43.       fi
  44.    else
  45.       echo "this is not raspberrypi kernel, no need to update touch configure, reboot"
  46. fi
  47.  
  48. sudo reboot
Add Comment
Please, Sign In to add comment