本文首发地址:https://blog.csdn.net/CSqingchen/article/details/123395496
最新更新地址:https://gitee.com/chenjim/chenjimblog
wsl --install,
sudo mv /etc/apt/sources.list /etc/apt/sources.list.baksudo vim /etc/apt/sources.listdeb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
sudo apt udpate && sudo apt upgradesudo apt-get install 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 fontconfigsudo apt-get install libssl-dev libncurses5
sudo apt-get install openjdk-8-jdk openjdk-8-jre
sudo apt-get install git
sudo apt-get install python3.7
sudo apt-get install python2 (如果没有python2)
sudo ln -s /usr/bin/python2 /usr/bin/python (如果repo命令报错没有python)
sudo apt-get install libssl-dev libtinfo5 libncurses5 (编译 xr 4100 代码)
sudo apt-get install libxml-simple-perl (编译 xr 5100 代码)

wsl -l -vwsl --export Ubuntu D:\Ubuntu_bak.tarwsl --unregister Ubuntuwsl --distribution Ubuntu 启动wsl --import Ubuntu_new D:\WSL_Ubuntu D:\Ubuntu_bak.tar --version 2ubuntu config --default-user chen如需给WSL添加虚拟磁盘,可参考
https://blog.csdn.net/CSqingchen/article/details/126266773
wsl --shutdowndiskpartDISKPART> Select vdisk file="D:\WSL_Ubuntu\ext4.vhdx"%LOCALAPPDATA%\Packages\xxxx\LocalState\ext4.vhdxGet-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyNamedetail vdiskexpand vdisk maximum=512000sudo mount -t devtmpfs none /devmount | grep ext4 其中输出的 /dev/sdX 在下一步用sudo resize2fs /dev/sdb 512000Mcurl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo && chmod +x reposudo mv repo /bin/repo~/.bashrc最后,替换默认Repo源,再重启终端即可export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'repo init -u https://github.com/LineageOS/android.git -b lineage-19.1repo syncsource build/envsetup.shlunch lineage****-userdebugmake -j$(nproc) 2>&1 | tee build.log brunch your_device_codenamefsutil.exe file SetCaseSensitiveInfo D:\code enable
相关文章连接
Window 10 使用WSL2下载编译Android 10 系统源码
how-to-build-lineageos-on-windows-10-using-wsl-2