gather_wz_logs.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. if [ -f /tmp/sd_check_result.txt ]; then
  42. echo "copy sd_check_result.txt"
  43. cp /tmp/sd_check_result.txt /opt/wz_mini/tmp/log_gather/sd_check_result.txt
  44. fi
  45. if [[ "$RTSP_PASSWORD" == "" ]]; then
  46. echo "password is blank in config"
  47. RTSP_PASSWORD=$(cat /opt/wz_mini/tmp/wlan0_mac)
  48. fi
  49. cd /opt/wz_mini/tmp/log_gather
  50. echo $RTSP_PASSWORD
  51. sed -e s/"$RTSP_PASSWORD"//g -i *
  52. cd /
  53. echo "compress to /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz"
  54. tar -czf /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz -C /opt/wz_mini/tmp log_gather/
  55. echo "cleanup, remove gather dir"
  56. rm -rf /opt/wz_mini/tmp/log_gather