在之前的文章不翻墙下载Android源码中,描述了如何通过中科大、清华的开源镜像下载Android AOSP源码。
其实Android还有一个部分容易被大家忽视的就是Android内核的源码,Android系统使用的是Linux内核,但与主线分枝的Linux内核又有一些差异。各个不同的厂商又有自己的修改。内核源码同样位于谷歌境外服务器,不翻墙无法访问,这给同步源码造成很大的不便。幸好清华大学的开源服务器上也同步了AOSP内核的源码,使得我们无须翻墙就可以同步源码。
下图为从清华服务器上同步common内核的过程,从截图看,速度还挺快的。
david@david-vm:~/code/kernel$ git clone https://aosp.tuna.tsinghua.edu.cn/kernel/common.git
正克隆到 'common'...
remote: Counting objects: 4644656, done.
remote: Total 4644656 (delta 0), reused 0 (delta 0)
接收对象中: 100% (4644656/4644656), 1.01 GiB | 2.51 MiB/s, 完成.
处理 delta 中: 100% (3891131/3891131), 完成.
检查连接... 完成。
注:上表中,common、hikey-linaro、lk均已验证,其余按照地址推算的,待验证。
另外,从中科大的开源服务器上看,也应该有Android内核源码的镜像,但不知为什么,同步时没有速度。