1.sudo adduser xxx sudo
2.sudo su -xxx
3.$ cd ~
$ tar -xzf dayomobile.ssh.tar.gz
$ chown -R $(whoami):$(whoami) ~/.ssh
4.ssh-add
提示:
Could not open a connection to your authentication agent.
解决:
则先执行如下命令即可:ssh-agent bash
5.mkdir -p ~/WORKING_DIRECTORY
cd ~/WORKING_DIRECTORY
6.安装repo
curl https://android.git.kernel.org/repo > ~/bin/repo
提示:
curl: (6) Couldn't resolve host 'android.git.kernel.org' 原因是因为android.git.kernel.org网站被黑了,所以无法从该网站下载repo和android源代码了解决:
- curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" >~/bin/repo
- 2. chmod a+x ~/bin/repo
- 3. PATH=~/bin:$PATH
7.repo init
提示:
OSError: [Errno 2] No such file or directory
原因:没有装git,faint
解决:
sudo apt-get install git
sudo apt-get install git-core
提示:
error.GitError: manifests var:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
解决:
看来的告知自己的身份才行。
运行:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.email "lihao921@gmail.com"
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.name "Cavin Lee"
再运行repo:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:45:00]$ ../bin/repo init -u git://android.git.kernel.org/platform/manifest.git
Your Name [Cavin Lee]:
Your Email [lihao921@gmail.com]:
Your identity is: Cavin Lee <lihao921@gmail.com>
is this correct [y/n]? y
Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/n)? y
repo initialized in /home/calvin/Android/Android2.0/source(出现这个提示说明成功了)
8.repo sync
提示:
fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp
解决:
这个错误。在网上查找各种帖子,最后发现,是最开始不清楚每个步骤惹得祸。在repo初始化时,应该先切换到你新建的文件夹下。开始没怎么注意,结果初始化的.repo 文件夹在主目录下,因为时隐藏的,没注意到,导致repo sync总出错。把主目录.repo文件夹删除后,重新初始化之后顺利执行
*********************************************************************************************************************************************************************************
与2014年2月15号编辑
1. 需要附件:
2. 在ubuntu系统建立用户帐号dayomobile:sudo adduser dayomobile
3. 切换至dayomobile用户:sudo su - dayomobile
4. 将附件(dayomobile.ssh.tar.gz)下载至dayomobile用户根目录下,然后解压并改变属主:cd ~ && tar -xzf dayomobile.ssh.tar.gz && chown -R $(whoami):$(whoami) ~/.ssh
5. 添加ssh密钥:ssh-add
提示:Could not open a connection to your authentication agent.
解决:执行如下命令即可:ssh-agent bash
6. 验证ssh连接
ssh -p 29418 source.rdamicro.com
**** Welcome to Gerrit Code Review ****
Hi dayomobile, you have successfully connected over SSH.
.....................................................
如有以上消息,说明ssh连接成功.
7. 初始化并同步代码
mkdir -p ~/WORKING_DIRECTORY
cd ~/WORKING_DIRECTORY
8. 安装repo
curl https://android.git.kernel.org/repo > ~/bin/repo
可能会提示:
curl: (6) Couldn't resolve host 'android.git.kernel.org' 原因是因为android.git.kernel.org网站被黑了,所以无法从该网站下载repo和android源代码了
解决:1.
curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" >~/bin/repo
9. repo init
repo init -u ssh://source.rdamicro.com:29418/android/platform/manifest.git -b rdadroid-4.2.2_r1-cr \
--repo-url=ssh://source.rdamicro.com:29418/android/tools/repo.git --no-repo-verify
提示:OSError: [Errno 2] No such file or directory
原因:没有装git,faint
安装:sudo apt-get install git && sudo apt-get install git-core
提示: error.GitError: manifests var:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
解决:看来的告知自己的身份才行。
运行:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.email "lihao921@gmail.com"
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.name "Cavin Lee"
再运行repo:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:45:00]$ ../bin/repo init –u /
git://android.git.kernel.org/platform/manifest.git
Your Name [Cavin Lee]:
Your Email [lihao921@gmail.com]:
Your identity is: Cavin Lee <lihao921@gmail.com>
is this correct [y/n]? y
Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/n)? y
repo initialized in /home/calvin/Android/Android2.0/source(出现这个提示说明成功了)
10. repo sync
repo sync -d -c
提示:
fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp
解决:
这个错误。在网上查找各种帖子,最后发现,是最开始不清楚每个步骤惹得祸。在repo初始化时,应该先切换到你新建的文件夹下。开始没怎么注意,结果初始化的.repo 文件夹在主目录下,因为时隐藏的,没注意到,导致repo sync总出错。把主目录.repo文件夹删除后,重新初始化之后顺利执行
注:红色标示部分为运行的命令行