1.安装wsl2

a.在windows 10 系统中启用wsl2(只能是wsl2,wsl1 会编译失败), 并商店中下载ubuntu镜像,商店默认安装位置为C:\Program Files\WindowsApps,考虑到编译需要100多G空间,需要把app移动到其他盘.

用管理员权限打开cmd

1 :: 切换到目录中
2 c:\Program Files\WindowsApps> cd /d "C:\Program Files\WindowsApps"
3 :: 查找文件夹名字
4 c:\Program Files\WindowsApps>dir | findstr Ubuntu20
5 2022/02/07 16:35 <DIR> CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.825.0_neutral_split.scale-100_79rhkp1fndgsc
6 2022/02/07 16:35 <DIR> CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.825.0_neutral_~_79rhkp1fndgsc
7 2022/02/07 16:35 <DIR> CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.825.0_x64__79rhkp1fndgsc
8
9 xcopy CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.825.0_x64__79rhkp1fndgsc e:\wsl /E/H/C/I

b.直接双击运行ubuntu2004.exe,

2.准备环境

安装环境
https://source.android.google.cn/setup/initializing?hl=zh-cn

aosp编译流程
https://source.android.google.cn/setup/building?hl=zh-cn

3.由于大部分库都在墙外,设置代理

 1 #repo设置proxy
2 export http_proxy=http://192.168.1.60:8080
3 export https_proxy=https://192.168.1.60:8080
4 #Git设置proxy
5 git config --global http.proxy http://192.168.1.60:8080
6 git config --global https.proxy http://192.168.1.60:8080
7#Git 取消proxy
8 git config --global --unset http.proxy
9 git config --global --unset https.proxy

4.下载代码,时间比较长.

1 $ mkdir ~/mokee
2 $ git config --global user.email "your@email.address"
3 $ git config --global user.name “Your Name”
4 $ cd ~/mokee
5
6 $ repo init -u https://github.com/MoKee/android -b mkq-mr1 --depth 1
7 $ repo sync -j4

5.执行breakfast.

 1 DESKTOP-AIAM0DF:~/mokee$ breakfast
2 You're building on Linux
3
4 Lunch menu... pick a combo:
5 1. aosp_arm-eng
6 2. aosp_arm64-eng
7 3. aosp_car_arm-userdebug
8 4. aosp_car_arm64-userdebug
9 5. aosp_car_x86-userdebug
10 6. aosp_car_x86_64-userdebug
11 7. aosp_x86-eng
12 8. aosp_x86_64-eng
13 9. car_x86_64-userdebug
14 10. m_e_arm-userdebug
15 11. mini_emulator_arm64-userdebug
16 12. mini_emulator_x86-userdebug
17 13. mini_emulator_x86_64-userdebug
18 14. mokee_arm-userdebug
19 15. mokee_arm64-userdebug
20 16. mokee_dumpling-eng
21 17. mokee_dumpling-user
22 18. mokee_dumpling-userdebug
23 19. mokee_x86-userdebug
24 20. mokee_x86_64-userdebug
25 21. qemu_trusty_arm64-userdebug
26 22. uml-userdebug
27
28 Which would you like? [aosp_arm-eng] ^C

如果列表中没有 mokee_dumpling-userdebug,

则往.repo/manifests/default.xml中添加

<project path="vendor/oneplus/dumpling" name="MoKee/android_vendor_oneplus_dumpling" clone-depth="1" />

<project path="device/oneplus/dumpling" name="MoKee/android_device_oneplus_dumpling" groups="pdk" />

怎么知道name="MoKee/android_device_oneplus_dumpling", 其实是直接在 https://github.com/MoKee  中搜索dumpling,根据xml格式自己添加的,

再次执行repo sync

6.执行 lunch mokee_dumpling-userdebug

7.执行 mka bacon

等待漫长的编译过程, 我16G内存,占用了大约12G.所以内存最好16G以上.

中间碰到几个错误,google下都解决了.

碰到的一些错误.
错误 cmd: unknown variable '$(PATH_OVERRIDE_SOONG)'
解决 breakfast
repo sync
mkbacon

编译Android时报错:error while loading shared libraries: libncurses.so.5: cannot open shared object file:
解决方式

https://blog.csdn.net/druieam/article/details/106818875

参考文档

How To Port CyanogenMod/LineageOS Android To Your Own Device

Build for dumpling

编译属于你自己的 Sultanized MoKee

小米8(Dipper)编译魔趣MK100全流程记录

在wsl 2中编译自己的魔趣(mokee) ROM的更多相关文章

  1. 使用 Windows 10 WSL 搭建 ESP8266 编译环境并使用 VSCODE 编程(一)(2019-08-23)

    目录 使用 Windows 10 WSL 搭建 ESP8266 编译环境并使用 VSCODE 编程 安装前准备 安装 ESP8266 工具链 下载 ESP8266 SDK 编译 花絮 使用 Windo ...

  2. Java--自定义Class并且在内存中编译,加载,实例化

    本文的目的: 使用者在程序运行期间,可以动态的写Java Class,不需要生成任何.Class文件就可以完全在内存中编译,加载,实例化. 1.需要用到的组件介绍 1)JavaCompiler:用于编 ...

  3. 在PLSQL中编译复杂的java(转)

    原文地址:在PLSQL中编译复杂的java PLSQL中可以编译运行JAVA程序. 一个简单的例子: create or replace and compile java source named x ...

  4. 在VS2012中编译WinXP兼容的程序

    VS2012默认是不兼容Windows XP的,编译链接出来的程序只能在Windows Vista及以上版本的操作系统上运行.可是有时需要在Windows XP上运行,又不得不用VS2012(例如用了 ...

  5. 在CentOS 6.4中编译安装gcc 4.8.1

    在CentOS 6.4中编译安装gcc 4.8.1 分类: C/C++ Linux/Unix2013-11-28 21:02 1877人阅读 评论(0) 收藏 举报 原文链接:http://www.c ...

  6. eclipse中编译时enum出现cannot be resolved to a type错误

    eclipse中编译时enum出现cannot be resolved to a type错误 通常是因为eclise使用的jdk版本的问题...默认是使用的是jdk1.5 应该去选择成jdk1.6或 ...

  7. [原]在Fedora中编译Libevent测试实例

    在我的昨天的博文<[原]我在Windows环境下的首个Libevent测试实例>中介绍了在Windows环境下如何编译一个echo server例子.今天我又试了一下在Linux环境中编译 ...

  8. Debian中编译内核

    转载: http://blog.163.com/libo_5/blog/static/156968520101016102051580/ http://hi.baidu.com/wg_wang/ite ...

  9. 在Eclipse中编译maven项目出的问题

    在Eclipse中编译Maven项目,运行 jetty:run 指令的时候会出错,在 JRE选项卡中加入: -Dorg.mortbay.util.URI.charset=GBK-Xms512m -Xm ...

  10. 在vs2010中编译log4cxx-0.10.0详细方法

    本文一共包含了17个步骤,按照下面的步骤就可以完成vs2010中编译log4cxx的工作了. 1. 下载 log4cxx 以及 apr 和 apr-util 源码: a) http://www.apa ...

随机推荐

  1. 大规模 IoT 边缘容器集群管理的几种架构-4-Kubeedge

    前文回顾 大规模 IoT 边缘容器集群管理的几种架构-0-边缘容器及架构简介 大规模 IoT 边缘容器集群管理的几种架构-1-Rancher+K3s 大规模 IoT 边缘容器集群管理的几种架构-2-H ...

  2. JZOJ 4216.平方和

    \(\text{Problem}\) 维护一个序列 支持插入一个数,区间加,询问区间平方和 \(\text{Solution}\) 平衡树很模板的题了 考场打 \(fhq-treap\) 毫无悬念过了 ...

  3. JZOJ 4279. 【NOIP2015模拟10.29B组】树上路径

    题目 现在有一棵n个点的无向树,每个点的编号在1-n之间,求出每个点所在的最长路. 思路 换根 \(dp\),这里只是记下怎么打 \(Code\) #include<cstdio> #in ...

  4. JZOJ 5451.Genocide

    题目 题解 对于 \(m=1\) 这档分 我们可以 \(dp\) 然后斜率优化 具体来说就是 \(f_i = f_j + \frac{(i-j)\times (i-j+1)}{2} + sum[j]- ...

  5. 题解 [SHOI2002] 百事世界杯之旅

    其实做这道题还蛮难受的...因为这个每一次有无限种可能我有钱我可以去买无限瓶可乐啊但是不是可口我不是很赞同┓( ´∀` )┏ 然后参考了这篇题解发现错位相减这样的方法,让我们一起膜拜 Butterfl ...

  6. 02#Web 实战:实现树形控件

    前言 这是一篇个人练习 Web 前端各种常见的控件.组件的实战系列文章.本篇文章将介绍个人通过 JQuery + 无序列表 + CSS 动画完成一个简易的树形控件. 最终实现的效果是: 这样结构比较复 ...

  7. RocketMQ - 消费者Rebalance机制

    客户端是通过Rebalance服务做到高可靠的.当发生Broker掉线.消费者实例掉线.Topic 扩容等各种突发情况时,消费者组中的消费者实例是怎么重平衡,以支持全部队列的正常消费的呢? Rebal ...

  8. Cesium之基础控件

    1. 引言 Cesium是一款三维地球和地图可视化开源JavaScript库,使用WebGL来进行硬件加速图形,使用时不需要任何插件支持,基于Apache2.0许可的开源程序,可以免费用于商业和非商业 ...

  9. 苹果手机iframe高度设定不生效而且无法滑动

    为iframe加个div.d1 .d1{ -webkit-overflow-scrolling: touch; overflow-y: scroll; height: 500px; 最好加上固定的高度 ...

  10. JS下载单个图片、单个视频;批量下载图片,批量下载视频

    下载单张图片 import JSZip from "jszip"; import FileSaver from "file-saver"; downloadIa ...