0117-DTS-Update-for-4.3-2020.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. diff --git a/UpdateDTS.sh.in b/UpdateDTS.sh.in
  2. index 3a5cb18..cc13780 100644
  3. --- a/UpdateDTS.sh.in
  4. +++ b/UpdateDTS.sh.in
  5. @@ -36,6 +36,93 @@ else
  6. bootpart="/dev/mmcblk0p1"
  7. fi
  8. +#---- create file /root/GfACheck4_3Display.sh
  9. +(\
  10. +cat << EOF
  11. +#!/bin/bash
  12. +KERNELREL=\`uname -r\`
  13. +DTSFILE=\`cat /proc/device-tree/vendorinfo/display_dtb\`
  14. +TOUCHCONTR=\`cat /sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0038/input/input2/name\`
  15. +
  16. +if [ \$KERNELREL == "4.4.104-bone-rt-r21" ]; then
  17. + echo -e "$DTSFILE\n\$TOUCHCONTR\n"
  18. + if [[ \$TOUCHCONTR == "EP0430M"* ]]; then
  19. + echo "4.3\" Display, check if Right DTS"
  20. +
  21. + if [ \$TOUCHCONTR == "EP0430MG1" ] && [ \$DTSFILE != "Display001_4_2020.dtb" -a \$DTSFILE != "Display001_4_nopruss_2020.dtb" ]; then
  22. + if [[ \$DTSFILE == *"_nopruss"* ]]; then
  23. + echo "switch to new2020 nopruss";
  24. + /root/DisplayTo_4_3inch_nopruss_2020.sh
  25. + reboot
  26. + else
  27. + echo "switch to new2020";
  28. + /root/DisplayTo_4_3inch_2020.sh
  29. + reboot
  30. + fi
  31. + fi
  32. + if [ \$TOUCHCONTR == "EP0430M09" ] && [ \$DTSFILE != "Display001_4.dtb" -a \$DTSFILE != "Display001_4_nopruss.dtb" ] ; then
  33. + if [[ \$DTSFILE == *"_nopruss"* ]]; then
  34. + echo "switch to old nopruss";
  35. + /root/DisplayTo_4_3inch_nopruss.sh
  36. + reboot
  37. + else
  38. + echo "switch to old";
  39. + /root/DisplayTo_4_3inch.sh
  40. + reboot
  41. + fi
  42. +
  43. + fi
  44. +
  45. + fi
  46. +else
  47. + echo "Kernelrelease (\$KERNELREL) not applicable"
  48. +fi
  49. +EOF
  50. +) > /root/GfACheck4_3Display.sh
  51. +chmod +x /root/GfACheck4_3Display.sh
  52. +
  53. +(\
  54. +cat << EOF
  55. +#!/bin/sh
  56. +umount /var/tmp/mnt 2> /dev/null
  57. +rm -rf /var/tmp/mnt 2> /dev/null
  58. +
  59. +from=/var/tmp/mnt/Display001_4_2020.dtb
  60. +to=/var/tmp/mnt/Display001.dtb
  61. +
  62. +such="root=/dev/mmcblk1"
  63. +grep -q \$such /proc/cmdline
  64. +if [ \$? == 0 ]
  65. +then
  66. + bootpart="/dev/mmcblk1p1"
  67. +else
  68. + bootpart="/dev/mmcblk0p1"
  69. +fi
  70. +
  71. +echo "Bootpart == \$bootpart"
  72. +
  73. +mkdir /var/tmp/mnt
  74. +mount \$bootpart /var/tmp/mnt
  75. +
  76. +if [ -e \$from ]
  77. +then
  78. + echo "copy \$from --> \$to"
  79. + cp \$from \$to
  80. + sync
  81. + echo "pls. reboot !!"
  82. +else
  83. + echo " no such file \$from"
  84. +fi
  85. +
  86. +umount /var/tmp/mnt 2> /dev/null
  87. +rm -rf /var/tmp/mnt 2> /dev/null
  88. +EOF
  89. +) > /root/DisplayTo_4_3inch_2020.sh
  90. +
  91. +chmod +x /root/DisplayTo_4_3inch_2020.sh
  92. +
  93. +#--------------------------------------------------
  94. +
  95. umount /mnt
  96. mount $bootpart /mnt
  97. @@ -116,11 +203,11 @@ if [ "$DONE" == "0" ]; then
  98. echo "Unknown Display Resolution"
  99. fi
  100. -
  101. -
  102. -
  103. #=================
  104. echo "Update Done, pls. reboot System"
  105. umount /mnt
  106. echo "."
  107. +
  108. +/root/GfACheck4_3Display.sh
  109. +
  110. exit 0