diff --git a/UpdateDTS.sh.in b/UpdateDTS.sh.in index 3a5cb18..cc13780 100644 --- a/UpdateDTS.sh.in +++ b/UpdateDTS.sh.in @@ -36,6 +36,93 @@ else bootpart="/dev/mmcblk0p1" fi +#---- create file /root/GfACheck4_3Display.sh +(\ +cat << EOF +#!/bin/bash +KERNELREL=\`uname -r\` +DTSFILE=\`cat /proc/device-tree/vendorinfo/display_dtb\` +TOUCHCONTR=\`cat /sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0038/input/input2/name\` + +if [ \$KERNELREL == "4.4.104-bone-rt-r21" ]; then + echo -e "$DTSFILE\n\$TOUCHCONTR\n" + if [[ \$TOUCHCONTR == "EP0430M"* ]]; then + echo "4.3\" Display, check if Right DTS" + + if [ \$TOUCHCONTR == "EP0430MG1" ] && [ \$DTSFILE != "Display001_4_2020.dtb" -a \$DTSFILE != "Display001_4_nopruss_2020.dtb" ]; then + if [[ \$DTSFILE == *"_nopruss"* ]]; then + echo "switch to new2020 nopruss"; + /root/DisplayTo_4_3inch_nopruss_2020.sh + reboot + else + echo "switch to new2020"; + /root/DisplayTo_4_3inch_2020.sh + reboot + fi + fi + if [ \$TOUCHCONTR == "EP0430M09" ] && [ \$DTSFILE != "Display001_4.dtb" -a \$DTSFILE != "Display001_4_nopruss.dtb" ] ; then + if [[ \$DTSFILE == *"_nopruss"* ]]; then + echo "switch to old nopruss"; + /root/DisplayTo_4_3inch_nopruss.sh + reboot + else + echo "switch to old"; + /root/DisplayTo_4_3inch.sh + reboot + fi + + fi + + fi +else + echo "Kernelrelease (\$KERNELREL) not applicable" +fi +EOF +) > /root/GfACheck4_3Display.sh +chmod +x /root/GfACheck4_3Display.sh + +(\ +cat << EOF +#!/bin/sh +umount /var/tmp/mnt 2> /dev/null +rm -rf /var/tmp/mnt 2> /dev/null + +from=/var/tmp/mnt/Display001_4_2020.dtb +to=/var/tmp/mnt/Display001.dtb + +such="root=/dev/mmcblk1" +grep -q \$such /proc/cmdline +if [ \$? == 0 ] +then + bootpart="/dev/mmcblk1p1" +else + bootpart="/dev/mmcblk0p1" +fi + +echo "Bootpart == \$bootpart" + +mkdir /var/tmp/mnt +mount \$bootpart /var/tmp/mnt + +if [ -e \$from ] +then + echo "copy \$from --> \$to" + cp \$from \$to + sync + echo "pls. reboot !!" +else + echo " no such file \$from" +fi + +umount /var/tmp/mnt 2> /dev/null +rm -rf /var/tmp/mnt 2> /dev/null +EOF +) > /root/DisplayTo_4_3inch_2020.sh + +chmod +x /root/DisplayTo_4_3inch_2020.sh + +#-------------------------------------------------- + umount /mnt mount $bootpart /mnt @@ -116,11 +203,11 @@ if [ "$DONE" == "0" ]; then echo "Unknown Display Resolution" fi - - - #================= echo "Update Done, pls. reboot System" umount /mnt echo "." + +/root/GfACheck4_3Display.sh + exit 0