Display2To_7inch_rs485_bitbang.sh 586 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. umount /var/tmp/mnt 2> /dev/null
  3. rm -rf /var/tmp/mnt 2> /dev/null
  4. from=/var/tmp/mnt/Display002_7_rs485_bitbang.dtb
  5. to=/var/tmp/mnt/Display001.dtb
  6. such="root=/dev/mmcblk1"
  7. grep -q $such /proc/cmdline
  8. if [ $? == 0 ]
  9. then
  10. bootpart="/dev/mmcblk1p1"
  11. else
  12. bootpart="/dev/mmcblk0p1"
  13. fi
  14. echo "Bootpart == $bootpart"
  15. mkdir /var/tmp/mnt
  16. mount $bootpart /var/tmp/mnt
  17. if [ -e $from ]
  18. then
  19. echo "copy $from --> $to"
  20. cp $from $to
  21. sync
  22. echo "pls. reboot !!"
  23. else
  24. echo " no such file $from"
  25. fi
  26. umount /var/tmp/mnt 2> /dev/null
  27. rm -rf /var/tmp/mnt 2> /dev/null