由于需要有输入密码的地方需要,需要安装expect
3 source ~/.bashrc
4 export JAVA_HOME=/home/songhanqing/tools/jdk1.6.0_31
7 export PATH=$JAVA_HOME/bin:$PATH
9 export PATH=$PATH:/usr/local/bin
10 export PATH=$PATH:/home/songhanqing/code/prebuilts/gcc/linux-x86/mips/mipsel-linux-android-4.7/bin
11 export PATH=$PATH:/home/songhanqing/bin
12
13 cd /home/songhanqing/soft_verison
14 rm -rf *
15 expect <<!
16 spawn repo init -u git://192.168.1.110/jzcode/m200_android4.3/manifest.git -m glass_p0.xml
17 expect "*[songhanqing]:*"
18 send "\r"
19
20 expect "*[songhanqing]*:"
21 send "\r"
22 send "y\r"
2 3 !
24 repo sync
25
26 source build/envsetup.sh
27 lunch magic-userdebug
28 cd bootable/bootloader/uboot
29 make coldwave_android_msc0
30 cd /home/songhanqing/soft_verison
31 cd ./kernel
48 spawn scp
32 make magic_lcos_android_defconfig
33 make zImage
34 cp arch/mips/boot/compressed/zImage ../device/ingenic/magic/kernel
35 cd ..
36 make bootimage
37 make update-api
38 make -j8
39 riqi=`date +%Y-%m-%d`
40 mkdir -p /home/songhanqing/$riqi
41
42 cp /home/songhanqing/soft_verison/bootable/bootloader/uboot/u-boot-with-spl-mbr-gpt.bin /home/songhanqing/$riqi
43 cp /home/songhanqing/soft_verison/out/target/product/magic/boot.img /home/songhanqing/$riqi
44 cp /home/songhanqing/soft_verison/out/target/product/magic/recovery.img /home/songhanqing/$riqi
45 cp /home/songhanqing/soft_verison/out/target/product/magic/system.img /home/songhanqing/$riqi
46 expect <<!
47 set timeout -1 48 spawn scp -r /home/songhanqing/$riqi supervisiontech@192.168.1.110:/home/ftp/jz_bin 49 expect "*assword:*" 50 send "vision\r" 51 expect 100% 52 expect eof 53 ! 原文链接:https://www.f2er.com/ubuntu/355647.html