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

编译树莓派镜像

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.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

/* 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
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lljwork2021

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值