From 7313437e83d5da20a42ea92486e73cfbb9330b99 Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 20 Mar 2019 12:22:32 +0000 Subject: [PATCH] auto install default display on DietPI --- build_sdcard.sh | 26 ++++++++++++++++++++++++-- dietpi/dietpi.display.sh | 8 ++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index fe03afc..f41760e 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -596,9 +596,31 @@ echo "" echo "IMPORTANT IF WANT TO MAKE A RELEASE IMAGE FROM THIS BUILD:" echo "login once after reboot without HDD and run 'XXprepareRelease.sh'" echo "" -echo "to continue reboot with sudo shutdown -r now and login with admin" -# install LCD only on an rPI running Raspbian +# install default LCD on DietPi without reboot to allow automatic build +if [ "${baseImage}" = "dietpi" ]; then + echo "Installing the default display available from Amazon" + # based on https://www.elegoo.com/tutorial/Elegoo%203.5%20inch%20Touch%20Screen%20User%20Manual%20V1.00.2017.10.09.zip + cd /home/admin/ + # sudo apt-mark hold raspberrypi-bootloader + git clone https://github.com/goodtft/LCD-show.git + sudo chmod -R 755 LCD-show + sudo chown -R admin:admin LCD-show + cd LCD-show/ + # sudo ./LCD35-show + sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf + sudo mkdir /etc/X11/xorg.conf.d + sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/ + sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo + sudo cp -rf ./usr/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf + sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/ + sudo cp ./usr/cmdline.txt /DietPI/ + sudo cp ./usr/inittab /etc/ + sudo cp ./boot/config-35.txt /DietPi/config.txt + echo "to continue reboot with \`sudo shutdown -r now \` and login with admin" +fi + +# ask about LCD only on Raspbian if [ "${baseImage}" = "raspbian" ]; then echo "Press ENTER to install LCD and reboot ..." read key diff --git a/dietpi/dietpi.display.sh b/dietpi/dietpi.display.sh index 339d35c..57e950c 100644 --- a/dietpi/dietpi.display.sh +++ b/dietpi/dietpi.display.sh @@ -101,7 +101,7 @@ if [ "${baseImage}" = "dietpi" ]; then echo "Installing the default display available from Amazon" # based on https://www.elegoo.com/tutorial/Elegoo%203.5%20inch%20Touch%20Screen%20User%20Manual%20V1.00.2017.10.09.zip - cd /home/admin/ + cd /home/admin/ #sudo apt-mark hold raspberrypi-bootloader git clone https://github.com/goodtft/LCD-show.git sudo chmod -R 755 LCD-show @@ -116,7 +116,7 @@ if [ "${baseImage}" = "dietpi" ]; then sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/ sudo cp ./usr/cmdline.txt /DietPI/ sudo cp ./usr/inittab /etc/ - sudo cp ./boot/config-35.txt /DietPi/config.tx + sudo cp ./boot/config-35.txt /DietPi/config.txt echo "***" echo "reboot with \`sudo reboot\` to have the LCD working" echo "***" @@ -127,7 +127,7 @@ if [ "${baseImage}" = "dietpi" ]; then echo "Installing the 3.5\" HDMI display from Aliexpress" # based on http://www.lcdwiki.com/3.5inch_HDMI_Display-B - git clone https://github.com/goodtft/LCD-show.git + git clone https://github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/ #sudo ./MPI3508-show @@ -137,7 +137,7 @@ if [ "${baseImage}" = "dietpi" ]; then sudo cp ./usr/inittab /etc/ sudo cp -rf ./usr/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf sudo mkdir -p /etc/X11/xorg.conf.d - sudo cp -rf ./usr/99-calibration.conf-3508 /etc/X11/xorg.conf.d/99-calibration.con + sudo cp -rf ./usr/99-calibration.conf-3508 /etc/X11/xorg.conf.d/99-calibration.conf echo "***" echo "reboot with \`sudo reboot\` to have the LCD working" echo "***"