当前位置: 首页 > news >正文

rk356x 关于yocto编译linux及bitbake实用方法

Yocto 完整编译

  source oe-init-build-envbitbake core-image-minimal

Yocto 查询包名

bitbake -s | grep XXX
// 获取rockchip相关包
:~/rk3568/yocto$ bitbake -s | grep rockchip
android-tools-conf-rockchip                           :1.0-r0
gstreamer1.0-rockchip                                 :1.0-r0
linux-rockchip                                       :5.10-r0                  :4.19-r0
rockchip-alsa-config                                  :1.0-r0
rockchip-libmali                                      :1.0-r0
rockchip-librga                                       :1.0-r0
rockchip-mpp                                          :1.0-r0
rockchip-npu                                          :1.0-r0
rockchip-rkaiq                                        :1.0-r0
udev-conf-rockchip                                    :1.0-r0

Yocto 确定包的源码目录

// 从包名确认内核名为linux-rockchip    
:~/rk3568/yocto$ bitbake -e linux-rockchip  | grep ^S=
S="/homexx/yocto/rk3568/yocto/build/tmp/work-shared/roc-rk3568-pc/kernel-source"

Yocto 确定包的下载地址

:~/rk3568/yocto$ bitbake -e linux-rockchip | grep ^SRC_URI=
SRC_URI="       git://gitlab.com/firefly-linux/kernel.git;protocol=https;nobranch=1;branch=rk356x/firefly;    file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/files/cgroups.cfg  file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/files/ext4.cfg file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0002-perf-parse-events-Use-asprintf-instead-of-strncpy-to.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0003-perf-tests-bp_account-Make-global-variable-static.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0004-libtraceevent-Fix-build-with-binutils-2.35.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0005-init-do_mounts.c-Retry-all-fs-after-failed-to-mount-.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0006-HACK-drm-rockchip-Force-enable-legacy-cursor-update.patch file:///home4/yocto/rk3568/yocto/build/../meta-rockchip/recipes-kernel/linux/linux-rockchip_4.19/0007-HACK-drm-rockchip-Prefer-non-cluster-overlay-planes.patch"

Yocto 编译内核

bitbake linux-rockchip -C compile

输出目录:build/tmp/deploy/images/

Yocto 查询当前recipe哪些tasks可执行

bitbake linux-rockchip -c listtasks
···
do_config_analysis
do_configure                          Configures the source by enabling and disabling any build-time and configuration options for the software being built
do_deploy                             Writes deployable output files to the deploy directory
do_deploy_setscene                    Writes deployable output files to the deploy directory (setscene version)
do_deploy_source_date_epoch
do_deploy_source_date_epoch_setscene   (setscene version)
do_devpyshell                         Starts an interactive Python shell for development/debugging
do_devshell                           Starts a shell with the environment set up for development/debugging
do_diffconfig                         Compares the old and new config files after running do_menuconfig for the kernel
do_fetch                              Fetches the source code
do_fixup_wks
do_install                            Copies files from the compilation directory to a holding area
do_kernel_checkout                    Checks out source/meta branches for a linux-yocto style kernel
do_kernel_configcheck                 Validates the kernel configuration for a linux-yocto style kernel
do_kernel_configme                    Assembles the kernel configuration for a linux-yocto style kernel
do_kernel_link_images                 Creates a symbolic link in arch/$arch/boot for vmlinux and vmlinuz kernel images
do_kernel_metadata
···

Yocto recipe 说明

在 Yocto 中,有几种不同类型的 recipe,其中两种主要的是 Package recipe 和 Image recipe。

  • Package recipe:
    Package recipe 用于定义如何构建一个软件包。它包括了软件包的元数据(比如名称、版本、许可证等)以及构建软件包所需的步骤(比如下载源码、配置、编译、安装等)。Package recipe 的文件扩展名通常是 .bb,例如 foo_1.0.bb。Package recipe 可以被其他 recipe 继承或扩展,以添加额外的配置或修改构建过程。
  • Image recipe:
    Image recipe 用于定义如何构建一个完整的镜像,包括了操作系统的核心组件、用户空间工具、库以及其他资源。Image recipe 定义了如何从各种软件包中组装这些组件,并将它们打包成一个可用于在目标设备上运行的镜像文件。Image recipe 的文件扩展名通常是 .bb,例如 myimage.bb。Image recipe 也可以被其他 recipe 继承或扩展,以添加额外的配置或修改构建过程。

参考:

  • bitbake手册
    bibake官方手册

  • yocto
    rk3588平台构建一个基础镜像
    什么是yocto
    yocto使用技巧
    yocto项目将编译目标安装到rootfs的过程

http://www.lryc.cn/news/341609.html

相关文章:

  • Chrome您的连接不是私密连接 |输入“thisisunsafe”命令绕过警告or添加启动参数
  • 牛客面试前端1
  • Linux的软件包管理器-yum
  • 选择排序(Selection Sort)
  • 网络面试题目
  • Web,Sip,Rtsp,Rtmp,WebRtc,专业MCU融屏视频混流会议直播方案分析
  • Unreal 编辑器工具 批量重命名资源
  • Voice Conversion、DreamScene、X-SLAM、Panoptic-SLAM、DiffMap、TinySeg
  • 短信群发平台分析短信群发的未来发展趋势
  • supervisord 使用指南
  • AngularJS 的生命周期和基础语法
  • docker-compose 网络
  • 农药生产厂污废水如何处理达标
  • 根据相同的key 取出数组中最后一个值
  • Github Action Bot 开发教程
  • 使用docker创建rocketMQ主从结构,使用
  • 一次完整的 http 请求是怎样的?
  • 并行执行的概念—— 《OceanBase 并行执行》系列 一
  • 使用 ipdb 调试回调函数
  • 介绍一下mybatis的基本配置(mybatis-config.xml)
  • 【MySQL】第一次作业
  • 10个免费视频素材网站,剪辑师们赶紧收藏!
  • 【毕业设计】基于SSM的运动用品商城的设计与实现
  • 【Web】CTFSHOW 中期测评刷题记录(1)
  • vs配置cplex12.10
  • Kubernetes 弃用Docker后 Kubelet切换到Containerd
  • 函数模板含有多个模板参数
  • Sprd Android 13 增加系统属性判断当前有无 OTG U盘插入,App 读取系统属性
  • 第11章 数据库技术(第一部分)
  • 数据结构––队列