本文转载博客,https://blog.csdn.net/u012855585/article/details/109178228 在此标示感谢, 笔者只是调整分类方法。

(1) Flexbuild主要功能介绍

Automatically build Linux, bootloader, miscellaneous user-space components and various Root File Systems (based on Ubuntu, Debian, CentOS, Yocto, Buildroot, etc).
自动构建Linux、bootloader、其他用户空间组件和各种根文件系统(基于Ubuntu、Debian、CentOS、Yocto、Buildroot等)。Generate machine-specific composite firmware for various boot types: SD/QSPI/XSPI/NOR/NAND normal boot and secure boot based on U-Boot or UEFI as bootloader.
为各种引导类型生成特定于机器的复合固件:SD/QSPI/XSPI/NOR/NAND正常引导和基于U-boot或UEFI作为引导加载程序的安全引导。Support repo integrated management with commands of repo-fetch, repo-branch, repo-commit, repo-tag, repo-update for all components.
支持repo集成管理,支持所有组件的repo-fetch, repo-branch, repo-commit, repo-tag, repo-update等命令。Support cross build on x86 Ubuntu 18.04 host machine for aarch64/armhf target.
为aarch64/armhf目标在x86 ubuntu18.04主机上支持交叉编译环境。Support native build on aarch64/armhf machine for Arm arch target.
支持在aarch64/armhf机器上为Arm arch目标进行本地编译。Support creating an Ubuntu docker container and building LSDK inside it when the host machine is using CentOS, RHEL, Fedora, SUSE, Debian, non-18.04 Ubuntu, etc.
支持在主机使用CentOS、RHEL、Fedora、SUSE、Debian、non-18.04 Ubuntu等时创建Ubuntu docker容器并在其中编译LSDK。Scalability of integrating various components of both system firmware and user space applications.
系统固件和用户空间应用程序的各种组件的可伸缩性。Capability of generating custom aarch64/armhf NXP LSDK userland integrated configurable packages and proprietary components.
能够生成用户空间集成了可配置包和专有组件的定制的 aarch64/armhf NXP LSDK 。Flexbuild可以单独构建每个组件或自动构建所有组件,它生成复合固件(包含RCW、U-Boot/UEFI、PHY固件、内核映像、dtb、initrd)和NXP LSDK userland(包含指定的包和应用组件)。

以LSDK2012为例,设备使用LS1046ARDB

$ tar xvzf flexbuild_<version>.tgz
$ cd flexbuild_<verison>
$ source setup.env
$ flex-builder -h
flex-builder -m ls1046ardb


Tips:用户可以在 /configs/build 中更改默认构建选项_lsdk.cfg公司启用/禁用某些生成功能。 例如,您可以通过按需设置CONFIG_app_<component_name>=y/n来启用/禁用某些应用程序组件。

(2) How to generate LSDK composite firmware如何生成复合固件

前面介绍的自动编译方式生成的固件包含了所有必要的组件,比如:一个完整的固件包含RCW、U-Boot/UEFI、PHY固件、内核映像、dtb、initrd和NXP LSDK userland(包含指定的包和应用组件),也可以通过手工的方式自己来单独编译、打包所有固件。

LSDK composite firmware consists of RCW/PBL, ATF, Bootloader(U-Boot or UEFI), secure headers, Ethernet MAC/PHY firmware, dtb, kernel and tiny initrd RFS. The composite firmware can be programmed at offset 0x0 in flash device or at offset block# 8 in SD/eMMC card.

复合固件可以直接烧写在flash的0X00处,也可以烧写在SD/EMMC的block# 8处,也就是该固件包含了所有的引导功能,可以直接启动设备。

$ flex-builder -i mkfw -m <machine> -b <boottype> [-B <bootloader>] [-s]
-m <machine>:指的是开发板名称
-b boottype:指的是存储介质类型  SD  XPSI  QSPI NOR
-B bootloader:指的是BootLoader类型,支持ubooot和uefi
-i mkfw:flex-builder的编译固件命令Examples:
$ flex-builder -i mkfw -m ls1028ardb -b sdfirmware_ls1028ardb_uboot_sdboot.img will be generated.指定固件启动介质是SD卡$ flex-builder -i mkfw -m lx2160ardb -b xspi -sfirmware_lx2160ardb_uboot_xspiboot_secure.img will be generated.指定固件启动介质是XSPI$ flex-builder -i mkfw -m ls1046ardb -b qspi -B uefifirmware_ls1046ardb_uefi_qspiboot.img will be generated.指定固件启动介质是QSPI$ flex-builder -i mkfw -m ls2088ardb -b norfirmware_ls2088ardb_uboot_norboot.img will be generated.$ flex-builder -i mkfw -m ls2088ardb -b nor -sfirmware_ls2088ardb_uboot_norboot_secure.img will be generated for secure boot.$ flex-builder -i mkfw -m lx2160ardb_rev2 -b xspi firmware_lx2160ardb_rev2_uboot_xspiboot.img will be generated.

(3) 如何单独编译内核

configs/build_lsdk.cfg是内核编译配置文件
关于LS1046A是多少位的处理器:64位,单击查看

$ flex-builder -c linux -a arm64  (for all Layerscale arm64 platforms) 这里使用arm64编译
$ flex-builder -c linux -a arm32  (for arm32 platform, e.g. ls1021atwr)
  • Tips:如果不想使用默认配置编译内核,可以使用如下命令指定内核版本和配置文件
Usage:  flex-builder -c linux:<kernel-repo>:<branch|tag> [ -a arm64 -B fragment:<custom>.config ]
Example:
$ flex-builder -c linux:dash-lts:linux-5.4 -a arm64 -B fragment:lttng.config
$ flex-builder -c linux:linux:LSDK-20.04-V4.14 -a arm32
$ flex-builder -c linux:linux:LSDK-20.04-V5.4 -a arm64
  • Tips: 用户自己可以添加特殊的配置文件,在以下路径创建一个配置文件test.config
flexbuild/packages/linux/<kernel-repo>/arch/arm64/configs
$ flex-builder -c linux -a arm64 -B fragment:test.config
  • Tips: 内核裁剪
    To build kernel with custom kernel options in interactive menu:
Step1: Use 'custom' option to customize kernel .config in interactive menu
$ flex-builder -c linux:custom -a arm64
先使用此命令通过图形交互界面生成定制的配置文件Step2: Continue to build kernel with the customized .config generated in Step1
$ flex-builder -c linux -a arm64
重新编译内核
  • Tips: 构建自定义内核发行版的linux-itb
    (u-boot推出了全新的image格式-----FIT uImage,就是itb),可以在<flexbuild_dir>/packages/linux/linux下面修改内核源码,也可以修改默认的内核源branch/tag,修改结束后编译内核即可.
$ flex-builder -i mkitb -r <distro_type>:<distro_scale> -a <arch>For example:$ flex-builder -i mkitb -r yocto:tiny  -a arm64$ flex-builder -i mkitb -r yocto:devel -a arm32$ flex-builder -i mkitb -r ubuntu:lite -a arm64$ flex-builder -i mkitb -r ubuntu:main -a arm64 (使用这个)
  • Tips: itb 镜像的装载
=> tftp $load_addr <itb_img>
=> bootm $load_addr#<board_name>
  • Tips: RootFS 镜像
    Optionally, the prebuilt rootfs_<lsdk_version>yocto_tiny_arm64.cpio.gz is used for generating itb image by default,
    另外,预编译好的RootFS默认被用于编译itb镜像文件rootfs
    <lsdk_version>_yocto_tiny_arm64.cpio.gz

你可以参考LSDK说明手册的 "How to build LSDK with Flexbuild"章节下的"How to build various userland with custom packages"来定制用户空间代码。

  • Tips: 生成LSDK的 启动分区压缩包 boot partition tarball
    引导分区包括kernel image, DTB, distro boot script, secure boot headers, tiny initrd等。flex builder会在您自己修改内核源或配置后,自动构建不存在的依赖映像,您可以运行以下命令来生成用于LSDK部署的bootpartition_LS_arm64_lts.tgz 压缩文件。
$ flex-builder -i mkbootpartition -a arm64  (for normal boot)(选这个)
or
$ flex-builder -i mkbootpartition -a arm32  (for normal boot)
or
$ flex-builder -i mkbootpartition -a arm64 -s (for secure boot)
or
$ flex-builder -i mkbootpartition -a arm32 -s (for secure boot)
or
$ flex-builder -i mkbootpartition -a arm64 -s -t (for secure boot with IMA-EVM)
or
$ flex-builder -i mkbootpartition -a arm32 -s -t (for secure boot with IMA-EVM)
  • Tips: 构建应用组件
Usage:  flex-builder -c <component-name> -a <arch>
Example:
$ flex-builder -c apps                # build all arm64 apps components against Ubuntu-based main userland by default
$ flex-builder -c apps -r yocto:devel # build all arm64 apps components against Yocto-based devel userland
$ flex-builder -c edgescale     # build EdgeScale client components for arm64 arch
$ flex-builder -c dpdk          # build DPDK component for Layerscape platforms
$ flex-builder -c ovs_dpdk      # build OVS-DPDK component
$ flex-builder -c pktgen_dpdk   # build PKTGEN-DPDK component
$ flex-builder -c vpp           # build VPP component
$ flex-builder -c fmc -a arm32  # build FMC component for arm32 arch
$ flex-builder -c fmc -a arm64  # build FMC component for arm64 arch
$ flex-builder -c restool       # build RESTOOL component for arm64 arch,
$ flex-builder -c tsntool       # build tsntool component
(arm64 is the default arch if -a <arch> is not specified)
  • Tips: 添加应用组件
Add new <component> to apps_repo_list and set CONFIG_BUILD_<component>=y in configs/build_xx.cfg.Configure url/branch/tag/commit info for new <component_name>in configs/build_xx.cfg, default remote. Component git repository is specified by GIT_REPOSITORY_URL by default if <component>_url is not specified, user also can directly create the new component git repository in packages/apps directory.Add build support of new component in packages/apps/Makefile..Run flex-builder -c <component-name> -a <arch>' to build the new component.Run flex-builder -i merge-component -a <arch> to merge the new component package into target distro userland.
  • Tips: 用定制的内核替换目标板上的默认内核(前提是没有使用 secure boot )
Step1: Optionally, run 'flex-builder -i repo-fetch -B linux' to download linux source, then modify Linux kernel source code in <flexbuild_dir>/packages/linux/<kernel-repo>Step2: Optionaly, customize kernel options in interactive menu by command "flex-builder -c linux:custom -a arm64"Step3: Build new kernel by command "flex-builder -c linux -a arm64"Step4: Generate new linux tarball by command "flex-builder -i mkbootpartition -a arm64"The new kernel tarball <flexbuild-dir>/build/images/linux_5.4_LS_arm64_<timestamp>.tgz will be generated.Step5: Login LSDK Linux system on target board and replace the existing kernel as below:
root@localhost:/# dhclient -i <port_name>
root@localhost:/# wget <webserver_path>/linux_5.4_LS_arm64_<timestamp>.tgz (or by scp command)
root@localhost:/# tar xfmv linux_5.4_LS_arm64_<timestamp>.tgz -C /
root@localhost:/# reboot
  • Tips: 修改本地组件源代码,部署新镜像
Step1: Clean the old apps images as below
$ flex-builder -i clean-apps -a arm64
$ make clean -C packages/apps/<component_name>Step2: Modify component source code in directory packages/apps/<component-name> on demandStep3: Build the component and generate the compressed app component tarball
$ flex_builder -c <component-name> -a arm64 (or run 'flex_builder -c apps' for building all components)
$ flex-builder -i packapps -a arm64Step4: Login LSDK Linux system on target board, download app_components_LS_arm64.tgz and replace the existing app component as below
root@localhost:/# wget <webserver_path>/app_components_LS_arm64.tgz (or by scp command)
root@localhost:~# tar xfm app_components_LS_arm64.tgz -C /
root@localhost:~# reboot
  • Tips: 添加新 App 组件到 Flexbuild
Add a new CONFIG_APP_<component>=y and configure <component>_repo_url and <component>_repo_branch in configs/build_lsdk.cfg. Or, you can directly create the new component git repository in packages/apps/<category>/<component>.
Add make object in packages/apps/<category>/<category>.mk, this is applicable to component, which uses either Make build system or non Make build system (For example, cmake, meson, ninja).Run flex-builder -c <component> -a <arch> to build new component.Run flex-builder -i merge-component -a <arch> to merge new component package into distro userland.Run flex-builder -i packrfs -a <arch> to pack the target distro userland for deployment.Note: -r <distro_type>:<distro_scale> can be specified if needed, -r ubuntu:main, by default. In case you just need to integrate a few simple source files which are not in a git repository, you can put them under packages/apps/generic directory and add make object in packages/apps/generic/generic.mk.

1 --> Flexbuild 在 LS1046 中应用记录相关推荐

  1. DataTable中数据记录的统计

    DataTable中数据记录的统计 我们在使用Sql Server这些数据库时,可以轻松的通过Sum.Aver.Count等统计出相关结果,那么,在已经把数据检索出来的DataSet(DataTabl ...

  2. Gridview导出到Excel,Gridview中的各类控件,Gridview中删除记录的处理

    Asp.net 2.0中新增的gridview控件,是十分强大的数据展示控件,在前面的系列文章里,分别展示了其中很多的基本用法和技巧(详见< ASP.NET 2.0中Gridview控件高级技巧 ...

  3. oracle取得表中总记录数最快的方法

    查询表中的记录总数的语法就是SELECT COUNT(*) FROM TABLE_NAME.这可能是最经常使用的一类SQL语句. 本文讨论怎样才能最快的得到这个记录数.本文纯粹主要是理论上的讨论,文章 ...

  4. php如何查询数据是否存在,PHP判断数据库中的记录是否存在的方法,php数据库_PHP教程...

    PHP判断数据库中的记录是否存在的方法,php数据库 本文实例讲述了PHP判断数据库中的记录是否存在的方法.分享给大家供大家参考. 具体实现代码如下: 复制代码 代码如下: $sql="se ...

  5. 解决在AX 2009中删除公司时提示:未授权用户##删除表“DEL_PBATRANSLATECONSISTOF”中的记录...

    操作 在AX 2009中执行删除公司操作 提示 英文:"User '[User_name]' is not authorized to delete a record in table 'D ...

  6. Oracle数据库中有关记录个数的查询

    一.查询表中全部的记录个数 可用两种方法,一种是在oracle的系统表中统计,另一种需要写存储过程统计,方法分别如下. 1.系统表中统计: SELECT sum(num_rows) FROM user ...

  7. [导入]C#向Sql Server中插入记录时单引号的处理

    ASP.Net种使用C#, 向CoreDB.myBBS表中插入记录值(Title, Content)[文章的标题和内容],由于Content, Title中可能包含单引号,直接使用sql的insert ...

  8. kafka查看topic中的数据_实战!Kafka Manager能统计出Topic中的记录条数吗?

    问题描述 今天现场实施同事说Kafka Manager上显示有3500w条记录,但使用我们的平台落地后,一统计发现只有2200w条记录,这是不是说明我们的平台存在丢数据的可能. 经了解,对接方是通过如 ...

  9. 获得 DataSet中的记录总数

      查看文章     获得 DataSet中的记录总数 2009-08-05 15:00 获得 2009-08-05 15:00 获得 DataSet中的记录总数 DataSet ds = new D ...

最新文章

  1. HDU - 5790 Prefix(主席树+字典树)
  2. winserver的consul部署实践与.net core客户端使用(附demo源码)
  3. 基于python的随机森林回归实现_随机森林理论与python代码实现
  4. Spring Batch:多种格式输出编写器
  5. Java开发人员应该知道的三件事
  6. html的实战性介绍
  7. 知道这些用于数据科学和机器学习的GitHub存储库和Reddit主题吗?
  8. 工况密度和标况密度怎么换算_什么是载流量?导线的载流量与电流密度怎么计算?图文详解!...
  9. (76)FPGA随机函数($dist_uniform)
  10. 【图像加密】基于matlab GUI Arnold置乱图像加密解密【含Matlab源码 1239期】
  11. 什么是 Refresh Token
  12. python编写鸡兔同笼程序_鸡兔同笼问题的python实现
  13. 什么是gzip?为什么要用gzip?使用gzip的优势和劣势是什么?需要哪些岗位进行配合才能够实现gzip内容的应用?
  14. PVE系列教程(十五)、安装Windows10系统(专业版、企业版、家庭版通用)
  15. 马王堆汉墓帛书‧老子——甲本释文(德经)
  16. 用鼠标模拟视线跟踪技术
  17. 常用python编程软件-现在编程软件有哪些?常用是哪一种?
  18. Kotlin初级(2)- - - 空安全.md
  19. 基于微信小程序的共享课本系统 毕业设计毕设参考
  20. multi-angle cosine and sines

热门文章

  1. Arcgis pro 布局视图标注、点符号等太小问题
  2. Numpy中的shape、reshape函数
  3. android获取Wifi路由地址,手机地址
  4. thymeleaf常用命名空间
  5. windows下批量关闭Nginx服务
  6. 组件分享之后端组件——基于Golang实现的基于LDAP V3协议的操作包ldap
  7. html5 div 拱桥形状制作,*石拱桥优秀的教案
  8. 超静音驱动芯片TMC2208-减少3D打印机的振动
  9. sm是什么职位_【SM是做什么的】HM2020年SM岗位职责-看准网
  10. 亚马逊发布AI跟踪系统,监督员工能否保持社交距离