编译树莓派镜像
- 1.前言
- 2.步骤
- 3.问题
1.前言
yocto版本:3.4
ubuntu版本:20.04(基于docker)
工具:vscode+remote-ssh插件
开发板:树莓派4B
官方参考文档
2.步骤
/* 1.安装yocto */
root@6dc066bac538:~# mkdir yocto && cd yocto
root@6dc066bac538:~/yocto# apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 \
libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool
root@6dc066bac538:~/yocto# git clone git://git.yoctoproject/poky
root@6dc066bac538:~/yocto/poky# git checkout -t origin/honister -b my-honister
root@6dc066bac538:~/yocto/poky# git pull
root@6dc066bac538:~/yocto# git clone git://git.yoctoproject/meta-raspberrypi
root@6dc066bac538:~/yocto# source poky/oe-init-build-env rpi-build
/* 2.配置bblayers.conf */
root@6dc066bac538:~/poky/rpi-build# vim conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/root/yocto/poky/meta \
/root/yocto/poky/meta-poky \
/root/yocto/meta-raspberrypi \ //修改此处为树莓派的BSP
"
/* 3.配置local.conf */
root@6dc066bac538:~/yocto/rpi-build# ls /root/yocto/meta-raspberrypi/conf/machine/
root@6dc066bac538:~/yocto/rpi-build# vim conf/local.conf
MACHINE ??= "raspberrypi4-64" //修改机器类型
/* 4.编译镜像 */
root@6dc066bac538:~/yocto/rpi-build# bitbake core-image-minimal
Build Configuration:
BB_VERSION = "1.53.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-20.04"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "raspberrypi4-64"
DISTRO = "poky"
DISTRO_VERSION = "3.4+snapshot-5d653957d599e3e5bf5ed453d7098aed92c2de3c"
TUNE_FEATURES = "aarch64 armv8a cortexa72"
TARGET_FPU = ""
meta
meta-poky = "master:5d653957d599e3e5bf5ed453d7098aed92c2de3c"
meta-raspberrypi = "master:836755370f5a61d96d62d5ff23e7b73c81032c8e"
3.问题
/* 问题一:权限问题 */
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Do not use Bitbake as root.
/* 解决方案 */
$ vim /root/yocto/poky/meta/classes/sanity.bbclass
# if 0 == os.getuid():
# raise_sanity_error("Do not use Bitbake as root.", d)
/* 问题二:环境问题 */
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Your system needs to support the en_US.UTF-8 locale.
/* 解决方案 */
$ locale -a
$ apt-get update
$ apt-get install locales-all
更多推荐
嵌入式linux之yocto(二)编译树莓派镜像
发布评论