1
2
|
git config
-
-
global
user.email
"youremil.com"
git config
-
-
global
user.name
"yourname"
|
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
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#目前下载清华的AOSP代码总出现问题, 有一个可行的方法就是下载最新的月更新tar包: 这个不省心 不推荐
#请参考:https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
wget https:
/
/
mirrors.tuna.tsinghua.edu.cn
/
aosp
-
monthly
/
aosp
-
latest.tar
tar xf aosp
-
latest.tar
# 第二种方法
cd
/
home
/
yourname
/
.
bin
curl https:
/
/
mirrors.tuna.tsinghua.edu.cn
/
git
/
git
-
repo
-
o repo
chmod
+
x repo
# 使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc里
export REPO_URL
=
'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
# 打开~/.bashrc,添加行:
export PATH
=
/
home
/
yourname
/
.
bin
:$PATH
source .bashrc
repo init
-
u https:
/
/
mirrors.tuna.tsinghua.edu.cn
/
git
/
AOSP
/
platform
/
manifest
-
b android
-
11.0
.
0_r46
repo sync
# 完成代码就同步下来了
# --depth=1 拉取代码的深度 不推荐 可能会出现网络问题导致代码异常
# 同步失败时 可尝试切换镜像源
1.
修改.repo
/
manifests.git
/
config
2.
修改 url 为 (中科大镜像) git:
/
/
mirrors.ustc.edu.cn
/
aosp
/
platform
/
manifest
#清华源的打包方式是没法在一开始就指定分支的, 所以需要切换:
#在.repo/manifests文件夹下切分支,在该文件下使用
git branch
-
a
#即可看到所有的分支信息,使用
git checkout <分支>
#切换到对应的分支即可,切换完后返回工作目录重新repo sync 一遍。
# 创建次级仓库 下载到所在目录
repo init
-
u https:
/
/
mirrors.tuna.tsinghua.edu.cn
/
git
/
AOSP
/
platform
/
manifest
-
b android
-
4.0
.
1_r1
-
-
mirror
# 以下说明假定镜像创建在 /usr/local/aosp/mirror 中。首先,创建并同步镜像本身。请注意 --mirror 标记,该标记只能在创建新客户端时指定
mkdir
-
p
/
usr
/
local
/
aosp
/
mirror
cd
/
usr
/
local
/
aosp
/
mirror
repo init
-
u https:
/
/
android.googlesource.com
/
mirror
/
manifest
-
-
mirror
repo sync
# 同步镜像后,您就可以从镜像创建新客户端了。请注意,您必须指定一个绝对路径
mkdir
-
p
/
usr
/
local
/
aosp
/
master
cd
/
usr
/
local
/
aosp
/
master
repo init
-
u
/
usr
/
local
/
aosp
/
mirror
/
platform
/
manifest.git
repo sync
|
1
2
|
# 删除所有 .git仓库 然后自己新建 git init
find .
-
name .git | xargs rm
-
fr
|
build ID | 标记 | 版本 | 支持的设备 | 安全补丁级别 |
---|---|---|---|---|
RQ3A.211001.001 | android-11.0.0_r46 | Android11 | Pixel 3、Pixel 3 XL、Pixel 3a、Pixel 3a XL、Pixel 4、Pixel 4 XL、Pixel 4a、Pixel 4a (5G)、Pixel 5 | 2021-10-01 |
https://bbs.pediy.com/thread-269575.htm
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/bash
echo
"==========start repo sync==="
repo init
-
u https:
/
/
mirrors.tuna.tsinghua.edu.cn
/
git
/
AOSP
/
platform
/
manifest
-
b android
-
6.0
.
1_r20
repo sync
-
j4
# -d --force-sync --no-clone-bundle
while
[ $?
=
1
]; do
echo “
=
=
=
=
=
=
sync failed, re
-
sync again
=
=
=
=
=
=
”
sleep
3
repo sync
-
j4
-
d
-
-
force
-
sync
-
-
no
-
clone
-
bundle
done
chmod a
+
x down.sh
.
/
down.sh
|
1
|
sudo apt update && sudo apt install
-
y git
-
core gnupg flex bison build
-
essential
zip
curl zlib1g
-
dev gcc
-
multilib g
+
+
-
multilib libc6
-
dev
-
i386 libncurses5 lib32ncurses5
-
dev x11proto
-
core
-
dev libx11
-
dev lib32z1
-
dev libgl1
-
mesa
-
dev libxml2
-
utils xsltproc unzip fontconfig python3.
7
openjdk
-
8
-
jdk rsync libssl
-
dev
|
1
2
3
4
5
6
7
8
9
10
|
apt update \
&& apt install
-
y git
-
core gnupg flex bison build
-
essential \
zip
curl zlib1g
-
dev gcc
-
multilib g
+
+
-
multilib libc6
-
dev
-
i386 \
lib32ncurses5
-
dev x11proto
-
core
-
dev libx11
-
dev lib32z1
-
dev \
libgl1
-
mesa
-
dev libxml2
-
utils xsltproc unzip fontconfig \
openjdk
-
8
-
jre
-
headless openjdk
-
8
-
jdk
-
headless python2.
7
\
libncurses5
sed
-
i
's/TLSv1.1,//'
/
etc
/
java
-
8
-
openjdk
/
security
/
java.security \
&& sed
-
i
's/TLSv1,//'
/
etc
/
java
-
8
-
openjdk
/
security
/
java.security \
&& ln
-
s
/
usr
/
bin
/
python2.
7
/
usr
/
bin
/
python
|
1
2
3
4
5
6
7
8
9
10
11
12
|
FROM ubuntu:
18.04
ARG userid
ARG groupid
ARG username
RUN apt update && apt install
-
y git
-
core gnupg flex bison build
-
essential
zip
curl zlib1g
-
dev gcc
-
multilib g
+
+
-
multilib libc6
-
dev
-
i386 libncurses5 lib32ncurses5
-
dev x11proto
-
core
-
dev libx11
-
dev lib32z1
-
dev libgl1
-
mesa
-
dev libxml2
-
utils xsltproc unzip fontconfig python3.
7
openjdk
-
8
-
jdk rsync libssl
-
dev
RUN groupadd
-
g $groupid $username \
&& useradd
-
m
-
u $userid
-
g $groupid $username \
&& echo $username >
/
root
/
username \
&& ln
-
s
/
usr
/
bin
/
python3.
7
/
usr
/
bin
/
python
ENV HOME
=
/
home
/
$username
ENV USER
=
$username
ENTRYPOINT chroot
-
-
userspec
=
$(cat
/
root
/
username):$(cat
/
root
/
username)
/
/
bin
/
bash
-
i
|
1
|
sudo docker build
-
-
build
-
arg userid
=
$(
id
-
u)
-
-
build
-
arg groupid
=
$(
id
-
g)
-
-
build
-
arg username
=
$(
id
-
un)
-
t aospbuild:android11 .
|
1
2
3
4
5
6
7
8
|
# 开机自启动
-
-
restart always
# 授予管理员权限
-
-
privileged
# 启动
docker run
-
it
-
v
/
mnt
/
android
/
android11:
/
android11:rw
-
-
privileged
-
-
restart always
-
-
name aospbuild aospbuild:android11
/
bin
/
bash
# 执行
chroot
-
-
userspec
=
$(cat
/
root
/
username):$(cat
/
root
/
username)
/
/
bin
/
bash
-
i
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
FROM ubuntu:
14.04
ARG userid
ARG groupid
ARG username
RUN apt
-
get update && apt
-
get install
-
y git
-
core gnupg flex bison gperf build
-
essential
zip
curl zlib1g
-
dev gcc
-
multilib g
+
+
-
multilib libc6
-
dev
-
i386 lib32ncurses5
-
dev x11proto
-
core
-
dev libx11
-
dev lib32z
-
dev ccache libgl1
-
mesa
-
dev libxml2
-
utils xsltproc unzip python openjdk
-
7
-
jdk rsync
RUN curl
-
o
/
usr
/
local
/
bin
/
repo https:
/
/
storage.googleapis.com
/
git
-
repo
-
downloads
/
repo \
&& echo
"d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220 /usr/local/bin/repo"
| sha256sum
-
-
strict
-
c
-
\
&& chmod a
+
x
/
usr
/
local
/
bin
/
repo
RUN groupadd
-
g $groupid $username \
&& useradd
-
m
-
u $userid
-
g $groupid $username \
&& echo $username >
/
root
/
username \
&& echo
"export USER="
$username >>
/
home
/
$username
/
.gitconfig
COPY gitconfig
/
home
/
$username
/
.gitconfig
RUN chown $userid:$groupid
/
home
/
$username
/
.gitconfig
ENV HOME
=
/
home
/
$username
ENV USER
=
$username
ENTRYPOINT chroot
-
-
userspec
=
$(cat
/
root
/
username):$(cat
/
root
/
username)
/
/
bin
/
bash
-
i
|
1
2
|
cp ~
/
.gitconfig gitconfig
docker build
-
-
build
-
arg userid
=
$(
id
-
u)
-
-
build
-
arg groupid
=
$(
id
-
g)
-
-
build
-
arg username
=
$(
id
-
un)
-
t android
-
build
-
trusty .
|
1
|
docker run
-
-
privileged
-
it
-
-
rm
-
v
/
android
/
android
/
android
-
6.0
.
1_r72
:
/
src android
-
build
-
trusty
|
编译之前需下载制定型号的驱动
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# 切换环境
source build
/
envsetup.sh
# 查看构建类型 序号 根据自己的手机型号 会有对应的标志 在常用链接里可以看见
lunch 序号
# 先清理一下工程
make clean
# 先整个编译一遍 可选
m
# 后续编译
make
-
j64
You're building on Linux
Lunch menu... pick a combo:
1.
aosp_arm
-
eng
2.
aosp_arm64
-
eng
3.
aosp_blueline
-
userdebug
4.
aosp_blueline_car
-
userdebug
5.
aosp_bonito
-
userdebug
6.
aosp_bonito_car
-
userdebug
|
1
2
3
4
|
source build
/
envsetup.sh
lunch 模拟器序号
# 不行用相对路径
emulator
|
1
2
3
|
# 需先 source lunch一下 否则找不到命令
# 先设置image 所在路径 直接刷会有提示
fastboot flashall
-
w
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
################1################
# 编译Android7 报错:
# FAILED: /bin/bash -c “prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll”
# 解决方法: 在android目录下输入命令:
export LC_ALL
=
C
# 再重新make
#用 export LC_ALL=C 来去除所有本地化的设置,让命令能正确执行
################2#################
# 下载源码报错
# curl 92 HTTP/2 stream 3 was not closed cleanly before end of the underlying
git config
-
-
global
http.version HTTP
/
1.1
git config
-
-
global
http.postBuffer
524288000
# LibreSSL SSL_connect: SSL_ERROR_SYSCALL 报错
git config
-
-
global
-
-
unset http.proxy
git config
-
-
global
-
-
unset https.proxy
git config
-
-
global
http.sslBackend
"openssl"
git config
-
-
global
http.sslVerify false
# fatal: unable to access 'https://aosp.tuna.tsinghua.edu.cn/platform/manifest/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
git config
-
-
global
http.sslverify false
###################################
/
Applications
/
Xcode.app
/
Contents
/
Developer
/
Platforms
/
MacOSX.platform
/
Developer
/
SDKs
/
Library
/
Developer
/
CommandLineTools
/
SDKs
|
更多【Android 系统源码下载编译刷机】相关视频教程:www.yxfzedu.com