gather_wz_logs.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. create_dir() {
  3. echo "creating gather dir"
  4. mkdir /opt/wz_mini/tmp/log_gather
  5. }
  6. if [ -d /opt/wz_mini/tmp/log_gather ] ; then
  7. echo "gather dir already present, deleting."
  8. rm -rf /opt/wz_mini/tmp/log_gather
  9. create_dir
  10. else
  11. create_dir
  12. fi
  13. echo "copy wz_mini logs"
  14. cp /opt/wz_mini/log/* /opt/wz_mini/tmp/log_gather/
  15. echo "gather impdbg"
  16. impdbg --enc_info > /opt/wz_mini/tmp/log_gather/enc_info
  17. echo "gather logcat"
  18. logcat -d > /opt/wz_mini/tmp/log_gather/logcat
  19. echo "gather callback"
  20. logread | grep callback > /opt/wz_mini/tmp/log_gather/callback.log
  21. echo "gather local_sdk"
  22. logread | grep local_sdk > /opt/wz_mini/tmp/log_gather/local_sdk.log
  23. echo "gather /dev"
  24. ls -l /dev > /opt/wz_mini/tmp/log_gather/dev.log
  25. echo "gather df"
  26. df -h > /opt/wz_mini/tmp/log_gather/df.log
  27. echo "gather libcallback logs"
  28. logread | grep "\[command\]" > /opt/wz_mini/tmp/log_gather/libcallback.log
  29. echo "gather process list"
  30. ps -T > /opt/wz_mini/tmp/log_gather/ps.log
  31. echo "gather mounts"
  32. mount > /opt/wz_mini/tmp/log_gather/mount.log
  33. echo "gather mmc"
  34. logread | grep -E "mmc|storage_dev|playback_dev|tf_prepare" > /opt/wz_mini/tmp/log_gather/mmc.log
  35. echo "gather lsmod"
  36. lsmod > /opt/wz_mini/tmp/log_gather/kmod.log
  37. echo "gather app.ver"
  38. cp /system/bin/app.ver /opt/wz_mini/tmp/log_gather/system_app.ver
  39. echo "gather mmc info"
  40. cat /sys/bus/mmc/devices/mmc1\:0001/mmc1\:0001\:1/* > /opt/wz_mini/tmp/log_gather/mmc_sys.log
  41. echo "gather lsusb"
  42. lsusb > /opt/wz_mini/tmp/log_gather/lsusb.log
  43. if [ -f /tmp/sd_check_result.txt ]; then
  44. echo "copy sd_check_result.txt"
  45. cp /tmp/sd_check_result.txt /opt/wz_mini/tmp/log_gather/sd_check_result.txt
  46. fi
  47. if [[ "$RTSP_PASSWORD" == "" ]]; then
  48. echo "password is blank in config"
  49. RTSP_PASSWORD=$(cat /opt/wz_mini/tmp/wlan0_mac)
  50. fi
  51. cd /opt/wz_mini/tmp/log_gather
  52. echo $RTSP_PASSWORD
  53. sed -e s/"$RTSP_PASSWORD"//g -i *
  54. cd /
  55. echo "compress to /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz"
  56. tar -czf /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz -C /opt/wz_mini/tmp log_gather/
  57. echo "cleanup, remove gather dir"
  58. rm -rf /opt/wz_mini/tmp/log_gather