1.搭建Yocto Linux编译所需要的环境
(1)编译Yocto源文件需要64 bit的ubuntu,下面以ubuntu22.04为例,安装编译所需环境。
sudo apt-get install 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 python3-git \
python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm g++ libstdc++6 \
lib32stdc++6 libpulse-dev libevent-dev ninja-build rpm2cpio libswitch \
perl
(2)检查工具的版本,如果版本低于或者没有需重新搭建
git --version 1.8.3.1 or greater
tar --version 1.27.1 or greater
python3 --version 3.6.0 or greater
gcc --version 5.0 or greater
repo --version 2.16.6 or greater
(3)搭建repo工具
mkdir -p ~/.bin
PATH="${HOME}/.bin:${PATH}"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+rx ~/.bin/repo
2.利用yocto的bitbake工具来构建文件系统, bitbake是一个类似于GNU的make的构建工具,主要是为了管理嵌入式Linxu交叉编译的各个版本和包。
source yocto/poky/oe-init-build-env (进入build目录)
bitbake core-image-minimal (编译最小的文件系统)
bitbake -c fetchall core-image-minimal (只下载不编译)
bitbake core-image-weston (编译带weston桌面的文件系统)
3.查看yocto版本
yocto/meta-poky/conf/distro/poky.conf
查看DISTRO_VERSION即可查看yocto版本
如:
DISTRO_VERSION = "4.0.9" /*yocto版本为4.0.9*/