嵌入式linux之yocto(二)编译树莓派镜像

嵌入式linux之yocto(二)编译树莓派镜像,第1张

嵌入式linux之yocto(二)编译树莓派镜像

编译树莓派镜像

1.前言2.步骤3.问题

1.前言

yocto版本:3.4
ubuntu版本:20.04(基于docker)
工具:vscode+remote-ssh插件
开发板:树莓派4B
官方参考文档

2.步骤
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.org/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.org/meta-raspberrypi
root@6dc066bac538:~/yocto# source poky/oe-init-build-env rpi-build


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
  "


root@6dc066bac538:~/yocto/rpi-build# ls /root/yocto/meta-raspberrypi/conf/machine/
root@6dc066bac538:~/yocto/rpi-build# vim conf/local.conf
MACHINE ??= "raspberrypi4-64" //修改机器类型



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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5702094.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存