环境:Ubuntu18.04
一.获取许可认证
根据darwin源码获取文档,使用“Alt+Ctrl+T”打开命令窗口,输入
$ssh-keygen
一直回车,回车,回车
可以看上图有生成了id_rsa文件,在/home/wangcen/.ssh/id_rsa位置(不同电脑位置不同,自己注意一下),需要将这个文件复制给君正的工作人员添加许可,才可以继续进行源码同步。但是该文件是隐藏的,所以我们进行如下操作:
①进入该文件所在的文件夹
$cd /home/wangcen/.ssh
②将该文件提取出来
$ls
$cp id_rsa.pub ~/
然后我们就可以看到在主文件夹里有这个id_rsa.pub文件了,
接下来将这个文件发给君正的工作人员进行许可认证后,然后我们就可以继续下去了。
二.Repo工具下载(依次输入以下四个命令,即可下载repo工具)
$mkdir project_workspace
$cd project_workspace
$wget http://git.ingenic.com.cn:8082/bj/repo
$chmod +x repo
三.源码同步
$./repo init -u ssh://sz_halley2@58.250.243.8:29418/mirror/darwin/project/manifest.git
出现错误一:
Unable to negotiate with xxx.xxx.xxx.xxx port 29418: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
解决办法(若没有config文件请建立一个):
$sudo vi /etc/ssh/ssh_config
在ssh_config文件里输入:
Host *
KexAlgorithms +diffie-hellman-group1-sha1
出现错误二:
解决办法(记住每次出现错误的时候,要强制将repo文件删除(输入rm .repo -RF)才可以输入源码链接):
$ git config --global user.email "输入你的邮箱"
$ git config --global user.name "输入你的姓名"
$ rm .repo -rf
出现错误三:
报错如下:
Unable to negotiate with xxxxxxxx: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
fatal: 无法读取远程仓库
no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
解决办法:
$sudo vi /etc/ssh/ssh_config
找到该行:
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blow fish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour
把下面这行添加到后边(不用加#):
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
保存即可。
解决上述问题后,输入以下源码同步代码,即可同步成功。
$ ./repo init -u ssh://sz_halley2@58.250.243.8:29418/mirror/darwin/project/manifest.git
$./repo sync
后面编译所需依赖的库:
sudo apt-get install autopoint
sudo apt-get install liblzo2-dev
sudo apt-get install build-essential
sudo apt-get install automake autoconf m4 libtool gettext
sudo apt-get install zlib1g-dev
sudo apt-get install libncurses5-dev libslang2-dev libselinux1-dev debhelper lsb-release
pkg-config po-debconf