准备
进入WSL2子系统,安装编译依赖:
sudo apt install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm
下载yocto
下载
wget https://git.yoctoproject.org/poky/snapshot/poky-yocto-3.3.4.tar.gz
解压
tar -zxvf poky-yocto-3.3.4.tar.gz

配置目标镜像
cd poky-yocto-3.3.4
source oe-init-build-env
默认生成build目录。
配置目标机器架构,这里选择ARM64。编辑build/conf目录下的local.conf文件。如下图,选择自己需要的版本。保存退出。

编译
bitbake core-image-minimal
第一次编译过程比较费时,根据自己电脑的配置和网速情况,耗费时间从3小时~8小时不等。

运行
runqemu qemuarm64
报错了

解决办法:
- 修改./poky-yocto-3.3.4/meta/conf/machine/include/qemu.inc里面,去掉screen。
MACHINE_FEATURES = "alsa bluetooth usbgadget screen vfat"
- 修改./poky-yocto-3.3.4/build/conf/local.conf里面,注释掉下面一句代码。
#PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
- 重新编译运行。
cd poky-yocto-3.3.4
source oe-init-build-env
bitbake core-image-minimal
runqemu qemuarm64

1674

被折叠的 条评论
为什么被折叠?



