前言 本篇记录如何迁移本地 Android repo 仓库,对此过程做以记录,谨防备份。 此迁移的基础是本地 repo 仓库是正常使用、并git管理各子项目,在迁移前把 子项目 commit 完成。 第一步 压缩本地 repo 仓库 tar -zcvf repo.tar.gz .repo/* 1 第二步 拷贝压缩文件到开发服务器虚拟机并 scp repo.tar.gz robox@192.168.88.253:/home/robox/android_build tar -zxvf repo.tar.gz 1 2 #第三步 搭建 repo 参考环境 在 home/robox 路径下,创建环境 $ mkdir bin && cd bin $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=${PATH}:~/bin 1 2 3 4 验证 repo 环境 robox@robox-Vostro-3681:~/android_build$ repo help usage: repo COMMAND [ARGS] The most commonly used repo commands are: abandon Permanently abandon a development branch branch View current topic branches branches View current topic branches checkout Checkout a branch for development cherry-pick Cherry-pick a change. diff Show changes between commit and working tree diffmanifests Manifest diff utility download Download and checkout a change gitc-delete Delete a GITC Client. gitc-init Initialize a GITC Client. grep Print lines matching a pattern info Get info on the manifest branch, current branch or unmerged branches init Initialize a repo client checkout in the current directory list List projects and their associated directories overview Display overview of unmerged project branches prune Prune (delete) already merged topics rebase Rebase local branches on upstream branch smartsync Update working tree to the latest known good revision stage Stage file(s) for commit start Start a new branch for development status Show the working tree status sync Update working tree to the latest revision upload Upload changes for code review See 'repo help <command>' for more information on a specific command. See 'repo help --all' for a complete list of recognized commands. Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 repo环境正常。 第四步 恢复 repo 仓库源码 在 home/robox/android_build 路径下还原源码 $ repo sync -l 1 源码还原后、验证代码分支 robox@robox-Vostro-3681:~/android_build$ repo branch virtualMachine | in all projects 1 2 第五步 安装android编译环境依赖包、并编译android镜像 #sudo apt-get install flex bison gperf build-essential tofrodos python-markdown libxml2-utils xsltproc # sudo apt-get install zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev # sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 uuid uuid-dev # sudo apt-get install gcc-multilib g++-multilib # sudo apt-get install openssh-server openssh-client # sudo apt-get install liblzo2-2 liblzo2-dev lzop zlib1g-dev liblz-dev # sudo apt-get install git-core curl subversion # sudo apt-get install u-boot-tools mtd-utils device-tree-compiler # sudo apt-get install android-tools-fsutils # sudo apt-get install openjdk-8-jdk # sudo apt-get install aptitude # sudo aptitude install libcurl4-openssl-dev nss-updatedb 1 2 3 4 5 6 7 8 9 10 11 12 编译 android 镜像 解决错误 由于 androoi 源码是 nxp 开源代码,早期搭建环境时,其中 vendor/nxp 目录闭源的 *.bin 文件内容 并没有在repo仓库中,需要手工压缩此部分内容,覆盖 home/robox/android_build/vendor/nxp 文件夹 内容。 再次编译 android 源码成功,本次 repo 仓库迁移成功,更换性能更强悍的服