readyForTarget.sh 757 B

12345678910111213141516171819202122232425262728
  1. #! /bin/bash
  2. if [ $# = 1 ];then
  3. branch_name=$1
  4. if [ "foo${branch_name}" != "foomain" ];then
  5. echo "Branch name not found!"
  6. exit 0
  7. fi
  8. #modify build date
  9. build_date="`date \"+%Y-%m-%d\"`"
  10. cd oem/etc && awk -v new_date="$build_date" '/^\[upgrade\]/{f=1} f==1 && /^date=/{sub(/=.*/, "=" new_date); f=0} 1' speaker.conf > temp.conf && mv temp.conf speaker.conf
  11. cd oem && tar cpf ../oem_backup.tar .
  12. date="`date \"+%Y%m%d\"`"
  13. SOFT_VERSION="`grep firmware oem/etc/speaker.conf | cut -d '=' -f2`"
  14. name="u_m2_g2_fs_v_${SOFT_VERSION}_d_${date}.img"
  15. tar -zcvf ${name} oem_backup.tar etc lib oem usr www
  16. rk_generate ${name} IPS-M2 ${SOFT_VERSION}
  17. else
  18. echo "usage:$0 branch-name"
  19. fi
  20. exit 0