ubuntu 自动编译

前端之家收集整理的这篇文章主要介绍了ubuntu 自动编译前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
由于需要有输入密码的地方需要,需要安装expect

sudoapt-get install expect
需要用expect 执行的脚本的地方加上
expect << ! //开始


! //结束
看下边红色标记
在copy文件的时候,发现总不能完全执行完就结束了,
发现是由于,expect 默认timeout为30秒,
所以添加 set timeout -1 这样为无穷大就可以了
看下边紫色标记
----------------

1 #!/bin/bash
2 source /etc/profile
3 source ~/.bashrc
4 export JAVA_HOME=/home/songhanqing/tools/jdk1.6.0_31
7 export PATH=$JAVA_HOME/bin:$PATH
8 export CLASSPATH=,:$JAVA_HOME/lib
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

猜你在找的Ubuntu相关文章