通过 asop代码构建Redroid

1.创建工作目录:

mkdir ~/asop
cd  ~/asop

2.获取repo工具:

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ./bin/repo
chmod a+x ./bin/repo

3.设置环境变量:

vi ~/.bashrc
+ export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
source ~/.bashrc

4.repo 初始化:

./bin/repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest --git-lfs --depth=1 -b android-12.0.0_r34

5.添加redroid:

git clone https://github.com/remote-android/local_manifests.git ~/asop/.repo/local_manifests -b 12.0.0

6.同步代码:
./bin/repo sync -c -j$(nproc) 线程过多请用下边的
./bin/repo sync -c -j8

7.安装redroid补丁:

mkdir redroid
cd redroid
git clone https://github.com/remote-android/redroid-patches.git 

~/redroid/redroid-patches/apply-patch.sh  ~/asop android-12.0.0_r34

8.编译redroid:(这里本人有android编译服务就没有用docker)

cd ~/asop
. build/envsetup.sh
lunch redroid_arm64-userdebug
m -j$(nproc)

9.chromium-webview报错和处理:
error: hooks is different in /home/furao/asop/.repo/projects/external/chromium-webview.git vs /home/furao/asop/.repo/project-objects/chromium-webview-stub.git
error.GitError: Cannot fetch --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync external/chromium-webview` to proceed.

处理方法:
./bin/repo sync --force-sync external/chromium-webview

./bin/repo sync -c -j8

10.检查chromium-webview:
find ~/asop/external/chromium-webview -type f -name "*.apk" -exec du -h {} +

11.打包

cd ~/asop/out/target/product/redroid_arm64
sudo mount system.img system -o ro
sudo mount vendor.img vendor -o ro
sudo tar --xattrs -avcf redroid12.tar.xz vendor -C system --exclude="./vendor" .
sudo umount system vendor

引用:

代号、标记和 build 号  |  Android Open Source Project

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值