1.下载repo工具
(1).创建bin,并加入到PATH中
mkdir ~/bin PATH=~/bin:$PATH(2).安装依赖库
sudoapt-getinstallbisong++-multilibgitgperflibxml2-utilsmakezlib1g-dev:i386zipliblz4-toollibncurses5libssl-devbcflexcurlpython-is-python3
sudoapt-getinstallgit-coregnupgflexbisonbuild-essentialzipcurlzlib1g-devgcc-multilibg++-multiliblibc6-dev-i386libncurses5lib32ncurses5-devx11proto-core-devlibx11-devlib32z1-devlibgl1-mesa-devlibxml2-utilsxsltprocunzipfontconfig
bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev python
apt install bison tree dpkg --add-architecture i386 apt update apt install libc6:i386 libncurses5:i386 libstdc++6:i386 apt install libxml2-utils sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386 sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev sudo apt-get install git-core gnupg flex bison gperf build-essential sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib sudo apt-get install libc6-dev-i386 sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4 sudo apt-get install lib32z-dev ccache
(3).下载repo并设置权限
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo chmod a+x ~/bin/repo
2.下载源码
(1).创建工作目录
mkdir aosp cd aosp
vim ~/.bashrc export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
git config --global user.email "gyp@gmail.com" git config --global user.name "gyp"
(2).初始化仓库(不指定版本,默认下载最近的代码)
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
(3).初始化并指定版本
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-11.0.0_r1
repoinit-uhttps://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest-bandroid-11.0.0_r46
repoinit-ugit://mirrors.ustc.edu.cn/aosp/platform/manifest-bandroid-12.0.0_r3
(4).同步源码
repo sync
3.驱动下载
https://source.android.google.cn/setup/build/downloading#obtaining-proprietary-binaries https://developers.google.cn/android/blobs-preview https://developers.google.cn/android/drivers repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-12.0.0_r3 https://developers.google.cn/android/drivers
4.下载内核源码
AOSP源码中并不包括内核源码,需要单独下载,内核源码有很多版本,比如common是通用的Linux内核,msm是用于使用高通MSM芯片的Android设备,goldfish是用于Android模拟器的内核源码。
(1).goldfish
mkdir kernel cd kernel
git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish.git
cd goldfish git branch -a
git checkout remotes/origin/android-goldfish-3.4
5.AOSP Android系统源码及内核源码
https://developer.sony.com/develop/open-devices/guides/aosp-build-instructions https://developer.sony.com/develop/open-devices/guides/aosp-build-instructions/build-aosp-android-android-11-0-0 https://source.android.google.cn/setup/start/build-numbers http://source.android.com/setup/start/build-numbers#source-code-tags-and-builds https://android.googlesource.com/kerne https://android.googlesource.com/kernel/msm/
Android studio导入AOSP系统源码及源码Debug调试
https://developer.android.google.cn/studio/debug#breakPoints Androidstudio导入Android系统源码 https://blog.csdn.net/qq_23327993/article/details/100932496 Android Studio导入系统源码 https://blog.csdn.net/m0_58241002/article/details/126543948 Android Studio导入Android平台源码 https://blog.csdn.net/xiaosayidao/article/details/79023369 Android Studio调试系统源码的方法 https://blog.csdn.net/dc3120/article/details/112384879?spm=1001.2014.3001.5502 AndroidStudio导入系统源码并对源码进行debug调试 https://blog.csdn.net/u014078003/article/details/123842413 Android Studio调试系统源码的三种方式 http://liuwangshu.cn/framework/aosp/5-debug-aosp.html
审核编辑:刘清
-
Android
+关注
关注
12文章
3927浏览量
127197 -
LINUX内核
+关注
关注
1文章
316浏览量
21627 -
msm芯片
+关注
关注
0文章
5浏览量
7745 -
BIN文件
+关注
关注
0文章
26浏览量
8274 -
AOSP
+关注
关注
0文章
16浏览量
6191
原文标题:AOSP Android11系统源码和内核源码
文章出处:【微信号:哆啦安全,微信公众号:哆啦安全】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
相关推荐
评论