本文首发地址: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.bak
sudo vim /etc/apt/sources.list
deb 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 upgrade
sudo 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 fontconfig
sudo 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 -v
wsl --export Ubuntu D:\Ubuntu_bak.tar
wsl --unregister Ubuntu
wsl --distribution Ubuntu
启动wsl --import Ubuntu_new D:\WSL_Ubuntu D:\Ubuntu_bak.tar --version 2
ubuntu config --default-user chen
如需给WSL添加虚拟磁盘,可参考
https://blog.csdn.net/CSqingchen/article/details/126266773
wsl --shutdown
diskpart
DISKPART> Select vdisk file="D:\WSL_Ubuntu\ext4.vhdx"
%LOCALAPPDATA%\Packages\xxxx\LocalState\ext4.vhdx
Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName
detail vdisk
expand vdisk maximum=512000
sudo mount -t devtmpfs none /dev
mount | grep ext4
其中输出的 /dev/sdX
在下一步用sudo resize2fs /dev/sdb 512000M
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo && chmod +x repo
sudo 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.1
repo sync
source build/envsetup.sh
lunch lineage****-userdebug
make -j$(nproc) 2>&1 | tee build.log
brunch your_device_codename
fsutil.exe file SetCaseSensitiveInfo D:\code enable
相关文章连接
Window 10 使用WSL2下载编译Android 10 系统源码
how-to-build-lineageos-on-windows-10-using-wsl-2