搭建编译环境

虚拟机

不推荐在虚拟机上安装/编译BSP,如果必须要在虚拟机上使用,请务必满足表格的配置要求,并且在编译时,尽量减少宿主机器这边的负载,或者说在编译时尽量不使用宿主机器。

我们推荐的编译系统为ubuntu 16.04 Desktop amd64位版本,对编译系统的最低机器要求如下:

项目要求
内存4G或更大
硬盘100G或更大
CPU4线程或更多
网络正常网络,没有限制端口

ubuntu系统的安装没有特殊要求,在安装完后,需要额外为系统安装一些软件来满足BSP的编译需求。

我们的编译环境使用的是yocto,因此编译环境的要求也是按照yocto的要求:yocto文档(老版本)yocto文档,我们这里将需要安装的软件总结如下:

yocto版本安装的软件

2.1

2.2

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm g++-multilib

2.3

2.4

2.5

2.6

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping libsdl1.2-dev xterm g++-multilib

如果需要打开menuconfig界面,需要额外安装

$ sudo apt-get install libncurses-dev

请根据下表来选择yocto的版本安装:

Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.

The table is being loaded. Please wait for a bit ...

平台BSP下载最新的meta-phytec tagyoctokernelBootloaderQT
AM65xALPHA4
  •  

3.1 Dunfelllinux-phytec-ti BSP-Yocto-TISDK-AM65xx-ALPHA4uboot-phytec BSP-Yocto-TISDK-AM65xx-ALPHA4
AM57xPD18.1.0
  •  
BSP-Yocto-TISDK-AM57xx-PD18.1.02.2 Mortylinux-phytec-ti v4.9.41-phy1uboot-phytec v2017.01-phy15.7
AM57xPD18.2.0
  •  
BSP-Yocto-TISDK-AM57xx-PD18.2.02.2 Mortylinux-phytec-ti v4.9.41-phy4uboot-phytec v2017.01-phy45.7
AM57xPD19.1.1
  •  
BSP-Yocto-TISDK-AM57xx-PD19.1.12.6 Thudlinux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD19.1.1uboot-phytec BSP-Yocto-TISDK-AM57xx-PD19.1.1
AM57xPD20.1.2
  •  
BSP-Yocto-TISDK-AM57xx-PD20.1.22.6 Thudlinux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD20.1.2uboot-phytec BSP-Yocto-TISDK-AM57xx-PD20.1.25.11
AM335xPD16.2.0
  •  
2.1.2-phy12.1 Krogothlinux-ti v4.4.19-phy2barebox v2016.07.0-phy35.6
AM335xPD17.1.3
  •  
2.2.4-phy42.2 Mortylinux-ti v4.4.141-phy2barebox v2017.06.1-phy45.7
AM335xPD17.2.0
  •  
2.3.2-phy22.3 Pyrolinux-mainline v4.9.47-phy2
5.8
AM335xPD17.2.1
  •  
2.3.3-phy12.3 Pyrolinux-mainline v4.9.47-phy2barebox v2017.10.0-phy25.8
AM335xPD17.2.2
  •  
2.3.3-phy22.3 Pyrolinux-mainline v4.9.98-phy1barebox v2017.10.0-phy35.8
AM335xPD19.1.0
  •  
2.5.2-phy22.5 Sumolinux-mainline v4.14.78-phy4barebox v2018.11.0-phy25.10
AM335xPD19.1.1
  •  
2.5.3-phy72.5 Sumolinux-mainline v4.14.78-phy6barebox v2018.11.0-phy35.10
i.MX6

Mira HTML5 v1.0

  •  
2.2.1-phy1
linux-mainline v4.1.36-phy3barebox v2016.11.0-phy4
i.MX6PD15.3.0
  •  
1.8.1-phy61.8 Fidolinux-mainline v4.1.18-phy4barebox v2015.11.0-phy4
i.MX6PD15.3.1
  •  
1.8.1-phy6-fix11.8 Fidolinux-mainline v4.1.18-phy5barebox v2015.11.0-phy4
i.MX6PD16.1.0
  •  
2.1.2-phy42.1 Krogothlinux-mainline v4.1.36-phy3barebox v2016.11.0-phy75.6
i.MX6PD16.1.1
  •  
2.1.3-phy52.1 Krogothlinux-mainline v4.1.46-phy2barebox v2016.11.0-phy75.6
i.MX6PD16.1.2
  •  
2.1.3-phy82.1 Krogothlinux-mainline v4.1.46-phy4barebox v2016.11.0-phy85.6
i.MX6PD18.1.0
  •  
2.4.3-phy42.4 Rockolinux-mainline v4.14.39-phy4barebox v2017.12.0-phy35.9
i.MX6PD18.1.1
  •  
2.4.4-phy22.4 Rockolinux-mainline v4.14.78-phy2barebox v2017.12.0-phy35.9
i.MX6PD18.1.2
  •  
2.4.4-phy62.4 Rockolinux-mainline v4.14.134-phy2barebox v2017.12.0-phy65.9
i.MX6PD20.1.0
  •  
2.7.4-phy22.7 Warriorlinux-mainline v4.19.100-phy3barebox v2019.11.0-phy25.12
i.MX6PD21.1.0
  •  
3.3.3-phy23.3 Hardknottlinux-mainline v5.10.48-phy2barebox v2021.04.0-phy45.15
i.MX6ulPD17.2.0
  •  
2.2.2-phy52.2 Mortylinux-mainline v4.12.4-phy4barebox v2017.04.0-phy35.7
i.MX6ulPD17.1.2
  •  
2.2.2-phy32.2 Morty

linux-imx v4.1.15-phy3

barebox v2017.04.0-phy35.7
i.MX6ulPD19.1.0
  •  
2.5.3-phy62.5 Sumo

linux-mainline v4.14.93-phy3

barebox v2019.01.0-phy35.10
i.MX6ulPD19.1.1
  •  
2.5.3-phy162.5 Sumolinux-mainline v4.14.184-phy1barebox v2019.01.0-phy75.10
i.MX6ulPD19.1.2
  •  
2.5.3-phy192.5 Sumolinux-mainline v4.14.213-phy1barebox v2019.01.0-phy95.10
i.MX6ulPD21.1.0
  •  
3.1.5-phy13.1 Dunfelllinux-mainline v5.4.91-phy1barebox v2020.09.0-phy35.14
i.MX6ulPD22.1.1
  •  
BSP-Yocto-Ampliphy-i.MX6UL-PD22.1.14.0 Kirkstonelinux-mainline v5.15.102-phy1barebox v2022.02.0-phy15.15
i.MX7PD18.1.1
  •  
v2.2.3-phy3
linux-phytec-fsl v4.9.11

i.MX7PD18.2.0
  •  
v2.2.3-phy52.2 Mortylinux-phytec-fsl v4.9.11-phy3u-boot v2017.03-phy25.8
i.MX7PD19.1.0
  •  
v2.5-phy22.6 Thudlinux-phytec-fsl v4.14.78u-boot v2018.03
i.MX8MPD19.1.0
  •  
2.5.3-phy122.5 Sumolinux-imx v4.14.98-phy4u-boot-imx v2018.03-phy45.10
i.MX8MMPD20.1.0
  •  
2.7.1-phy22.7 Warriorlinux-imx v4.19.35_1.1.0-phy4u-boot-imx v2019.04_1.1.0-phy55.12
i.MX8MMPD22.1.1
  •  
BSP-Yocto-NXP-i.MX8MM-PD22.1.13.3 Hardknottlinux-imx v5.10.72_2.2.0-phy17u-boot-imx v2021.04_2.2.0-phy135.15
i.MX8MPALPHA2
  •  

3.0 Zeuslinux-imx v5.4.70_2.3.0-phy5u-boot-imx v2020.04_2.3.0-phy3
i.MX8MPPD21.1.0
  •  
3.0.4-phy123.0 Zeuslinux-imx v5.4.70_2.3.2-phy3u-boot-imx v2020.04_2.3.2-phy35.15
i.MX8MPPD21.1.1
  •  
v3.0.4-phy153.0 Zeuslinux-imx v5.4.70_2.3.2-phy5u-boot-imx v2020.04_2.3.2-phy35.15
i.MX8MPPD21.1.3
  •  
BSP-Yocto-FSL-i.MX8MP-PD21.1.33.0 Zeuslinux-imx v5.4.70_2.3.2-phy12u-boot-imx v2020.04_2.3.2-phy105.15
i.MX8MPPD22.1.0
  •  
BSP-Yocto-NXP-i.MX8MP-PD22.1.03.3 
Hardknott
linux-imx v5.10.72_2.2.0-phy9u-boot-imx v2021.04_2.2.0-phy75.15
i.MX8MPPD22.1.1
  •  
BSP-Yocto-NXP-i.MX8MP-PD22.1.13.3 Hardknottlinux-imx v5.10.72_2.2.0-phy17u-boot-imx v2021.04_2.2.0-phy135.15
STM32MP1PD20.1.0
  •  
2.6.3-phy42.6 Thudlinux-stm32mp v4.19.94u-boot v2018.115.11
RK3288PD17.1.1
  •  
2.2.1-phy32.2 Mortylinux-mainline v4.9.18-phy1

barebox v2016.07.0-phy5

u-boot-spl v2016.01-phy3

5.7
RK3288PD17.1.3
  •  
2.2.4-phy62.2 Mortylinux-mainline v4.9.98-phy2

barebox v2016.07.0-phy5

u-boot-spl v2016.01-phy3

5.7
RK3288PD-ALPHA2
  •  
2.1.1-phy12.1 Krogothlinux-mainline v4.4.16-phy2

barebox v2016.07.0-phy2

u-boot-spl v2016.01-phy2


在安装完后,即可开始下载/编译BSP。

下载/编译离线BSP

我们有两种BSP的下载方法

BSP下载方法优点缺点
离线编译包可直接编译镜像,默认镜像不需要额外的下载source中某些layer的git无法使用,一般这个没有什么影响。
phyLinux脚本可以方便的下载各个版本的BSP国内网络原因,这个方法需要下载很多包,很慢,且容易出错。

因此一般推荐使用离线编译包。

我们的下载地址为http://ftp.phytec.cn,你可以在这里找到以cpu名称命名的文件夹,在文件夹中,你可以看到各个版本的BSP,我们BSP版本的命名规则为:

BSP-Yocto-CPU名称-PD发布年份-大版本号-小版本号

i.MX6ul有两个版本的内核可以选择,分别是Vendor(linux-imx)内核和Mainline(linux-mainline)内核,请阅读:Mainline与Vendor内核 / Mainline and Vendor Kernel 来选择,如果还是不清楚请联系销售或发邮件给support@phytec.cn

内核和BSP版本的对应关系请看下表:

Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.

The table is being loaded. Please wait for a bit ...

平台 BSP下载 最新的 meta-phytec tag yocto kernel Bootloader QT
AM65x ALPHA4
  •  

3.1 Dunfell linux-phytec-ti BSP-Yocto-TISDK-AM65xx-ALPHA4 uboot-phytec BSP-Yocto-TISDK-AM65xx-ALPHA4
AM57x PD18.1.0
  •  
BSP-Yocto-TISDK-AM57xx-PD18.1.0 2.2 Morty linux-phytec-ti v4.9.41-phy1 uboot-phytec v2017.01-phy1 5.7
AM57x PD18.2.0
  •  
BSP-Yocto-TISDK-AM57xx-PD18.2.0 2.2 Morty linux-phytec-ti v4.9.41-phy4 uboot-phytec v2017.01-phy4 5.7
AM57x PD19.1.1
  •  
BSP-Yocto-TISDK-AM57xx-PD19.1.1 2.6 Thud linux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD19.1.1 uboot-phytec BSP-Yocto-TISDK-AM57xx-PD19.1.1
AM57x PD20.1.2
  •  
BSP-Yocto-TISDK-AM57xx-PD20.1.2 2.6 Thud linux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD20.1.2 uboot-phytec BSP-Yocto-TISDK-AM57xx-PD20.1.2 5.11
AM335x PD16.2.0
  •  
2.1.2-phy1 2.1 Krogoth linux-ti v4.4.19-phy2 barebox v2016.07.0-phy3 5.6
AM335x PD17.1.3
  •  
2.2.4-phy4 2.2 Morty linux-ti v4.4.141-phy2 barebox v2017.06.1-phy4 5.7
AM335x PD17.2.0
  •  
2.3.2-phy2 2.3 Pyro linux-mainline v4.9.47-phy2
5.8
AM335x PD17.2.1
  •  
2.3.3-phy1 2.3 Pyro linux-mainline v4.9.47-phy2 barebox v2017.10.0-phy2 5.8
AM335x PD17.2.2
  •  
2.3.3-phy2 2.3 Pyro linux-mainline v4.9.98-phy1 barebox v2017.10.0-phy3 5.8
AM335x PD19.1.0
  •  
2.5.2-phy2 2.5 Sumo linux-mainline v4.14.78-phy4 barebox v2018.11.0-phy2 5.10
AM335x PD19.1.1
  •  
2.5.3-phy7 2.5 Sumo linux-mainline v4.14.78-phy6 barebox v2018.11.0-phy3 5.10
i.MX6

Mira HTML5 v1.0

  •  
2.2.1-phy1
linux-mainline v4.1.36-phy3 barebox v2016.11.0-phy4
i.MX6 PD15.3.0
  •  
1.8.1-phy6 1.8 Fido linux-mainline v4.1.18-phy4 barebox v2015.11.0-phy4
i.MX6 PD15.3.1
  •  
1.8.1-phy6-fix1 1.8 Fido linux-mainline v4.1.18-phy5 barebox v2015.11.0-phy4
i.MX6 PD16.1.0
  •  
2.1.2-phy4 2.1 Krogoth linux-mainline v4.1.36-phy3 barebox v2016.11.0-phy7 5.6
i.MX6 PD16.1.1
  •  
2.1.3-phy5 2.1 Krogoth linux-mainline v4.1.46-phy2 barebox v2016.11.0-phy7 5.6
i.MX6 PD16.1.2
  •  
2.1.3-phy8 2.1 Krogoth linux-mainline v4.1.46-phy4 barebox v2016.11.0-phy8 5.6
i.MX6 PD18.1.0
  •  
2.4.3-phy4 2.4 Rocko linux-mainline v4.14.39-phy4 barebox v2017.12.0-phy3 5.9
i.MX6 PD18.1.1
  •  
2.4.4-phy2 2.4 Rocko linux-mainline v4.14.78-phy2 barebox v2017.12.0-phy3 5.9
i.MX6 PD18.1.2
  •  
2.4.4-phy6 2.4 Rocko linux-mainline v4.14.134-phy2 barebox v2017.12.0-phy6 5.9
i.MX6 PD20.1.0
  •  
2.7.4-phy2 2.7 Warrior linux-mainline v4.19.100-phy3 barebox v2019.11.0-phy2 5.12
i.MX6 PD21.1.0
  •  
3.3.3-phy2 3.3 Hardknott linux-mainline v5.10.48-phy2 barebox v2021.04.0-phy4 5.15
i.MX6ul PD17.2.0
  •  
2.2.2-phy5 2.2 Morty linux-mainline v4.12.4-phy4 barebox v2017.04.0-phy3 5.7
i.MX6ul PD17.1.2
  •  
2.2.2-phy3 2.2 Morty

linux-imx v4.1.15-phy3

barebox v2017.04.0-phy3 5.7
i.MX6ul PD19.1.0
  •  
2.5.3-phy6 2.5 Sumo

linux-mainline v4.14.93-phy3

barebox v2019.01.0-phy3 5.10
i.MX6ul PD19.1.1
  •  
2.5.3-phy16 2.5 Sumo linux-mainline v4.14.184-phy1 barebox v2019.01.0-phy7 5.10
i.MX6ul PD19.1.2
  •  
2.5.3-phy19 2.5 Sumo linux-mainline v4.14.213-phy1 barebox v2019.01.0-phy9 5.10
i.MX6ul PD21.1.0
  •  
3.1.5-phy1 3.1 Dunfell linux-mainline v5.4.91-phy1 barebox v2020.09.0-phy3 5.14
i.MX6ul PD22.1.1
  •  
BSP-Yocto-Ampliphy-i.MX6UL-PD22.1.1 4.0 Kirkstone linux-mainline v5.15.102-phy1 barebox v2022.02.0-phy1 5.15
i.MX7 PD18.1.1
  •  
v2.2.3-phy3
linux-phytec-fsl v4.9.11

i.MX7 PD18.2.0
  •  
v2.2.3-phy5 2.2 Morty linux-phytec-fsl v4.9.11-phy3 u-boot v2017.03-phy2 5.8
i.MX7 PD19.1.0
  •  
v2.5-phy2 2.6 Thud linux-phytec-fsl v4.14.78 u-boot v2018.03
i.MX8M PD19.1.0
  •  
2.5.3-phy12 2.5 Sumo linux-imx v4.14.98-phy4 u-boot-imx v2018.03-phy4 5.10
i.MX8MM PD20.1.0
  •  
2.7.1-phy2 2.7 Warrior linux-imx v4.19.35_1.1.0-phy4 u-boot-imx v2019.04_1.1.0-phy5 5.12
i.MX8MM PD22.1.1
  •  
BSP-Yocto-NXP-i.MX8MM-PD22.1.1 3.3 Hardknott linux-imx v5.10.72_2.2.0-phy17 u-boot-imx v2021.04_2.2.0-phy13 5.15
i.MX8MP ALPHA2
  •  

3.0 Zeus linux-imx v5.4.70_2.3.0-phy5 u-boot-imx v2020.04_2.3.0-phy3
i.MX8MP PD21.1.0
  •  
3.0.4-phy12 3.0 Zeus linux-imx v5.4.70_2.3.2-phy3 u-boot-imx v2020.04_2.3.2-phy3 5.15
i.MX8MP PD21.1.1
  •  
v3.0.4-phy15 3.0 Zeus linux-imx v5.4.70_2.3.2-phy5 u-boot-imx v2020.04_2.3.2-phy3 5.15
i.MX8MP PD21.1.3
  •  
BSP-Yocto-FSL-i.MX8MP-PD21.1.3 3.0 Zeus linux-imx v5.4.70_2.3.2-phy12 u-boot-imx v2020.04_2.3.2-phy10 5.15
i.MX8MP PD22.1.0
  •  
BSP-Yocto-NXP-i.MX8MP-PD22.1.0 3.3 
Hardknott
linux-imx v5.10.72_2.2.0-phy9 u-boot-imx v2021.04_2.2.0-phy7 5.15
i.MX8MP PD22.1.1
  •  
BSP-Yocto-NXP-i.MX8MP-PD22.1.1 3.3 Hardknott linux-imx v5.10.72_2.2.0-phy17 u-boot-imx v2021.04_2.2.0-phy13 5.15
STM32MP1 PD20.1.0
  •  
2.6.3-phy4 2.6 Thud linux-stm32mp v4.19.94 u-boot v2018.11 5.11
RK3288 PD17.1.1
  •  
2.2.1-phy3 2.2 Morty linux-mainline v4.9.18-phy1

barebox v2016.07.0-phy5

u-boot-spl v2016.01-phy3

5.7
RK3288 PD17.1.3
  •  
2.2.4-phy6 2.2 Morty linux-mainline v4.9.98-phy2

barebox v2016.07.0-phy5

u-boot-spl v2016.01-phy3

5.7
RK3288 PD-ALPHA2
  •  
2.1.1-phy1 2.1 Krogoth linux-mainline v4.4.16-phy2

barebox v2016.07.0-phy2

u-boot-spl v2016.01-phy2


在选择了想要编译的BSP版本后,可以下载对应的BSP包,这个包一般在3GB左右,命名为:

BSP-Yocto-CPU名称-PD版本号.src.mirror.tar.xz

推荐直接在ubuntu系统中用wget或其他下载工具如uget等下载。

请注意在所有以下操作都不要在root用户下操作,请使用普通用户来执行这些指令。

下载完成后将解压到一个目录中,推荐放在当前用户的home(~)下的文件夹中

以下以PD17.1.2的BSP为例:

解压完的目录结构
xxx@debian8:~/bsp/BSP-Yocto-Vendor-phyBOARD-Segin-PD17.1.2$ tree -L 2
.
├── build <-- 编译目录
│   └── conf <-- BSP的个人配置文件在这里
├── HOWTO
├── sources <-- 所有的yocto layer在这里
│   ├── meta-openembedded <-- openembedded目录,包含很多软件
│   ├── meta-phytec <-- 我司硬件适配layer
│   ├── meta-qt5
│   ├── meta-yogurt <-- 我司的参考镜像配置
│   └── poky <-- yocto核心代码
├── src_mirror <-- 所有要编译的源码压缩包位置
│   ├── acl-2.2.52.src.tar.gz
│   ├── acl-2.2.52.src.tar.gz.done
..............................此处省略
└── tools
    ├── init
    └── templateconf

12 directories, 532 files

然后初始化环境变量,请在BSP解压缩后的文件夹中执行该指令,执行后目录会自动切换到build文件夹下:

xxx@debian8:~/bsp/temp/BSP-Yocto-Vendor-phyBOARD-Segin-PD17.1.2$ source sources/poky/oe-init-build-env

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'


██████╗ ██╗  ██╗██╗   ██╗████████╗███████╗ ██████╗
██╔══██╗██║  ██║╚██╗ ██╔╝╚══██╔══╝██╔════╝██╔════╝
██████╔╝███████║ ╚████╔╝    ██║   █████╗  ██║     
██╔═══╝ ██╔══██║  ╚██╔╝     ██║   ██╔══╝  ██║     
██║     ██║  ██║   ██║      ██║   ███████╗╚██████╗
╚═╝     ╚═╝  ╚═╝   ╚═╝      ╚═╝   ╚══════╝ ╚═════╝


Welcome to the PHYTEC BSP-Yocto buildsystem.

Before building for the first time, you should take a look in the main
configuration file 'conf/local.conf'. There you can tweak the build system
settings and license configuration. For example you may have to accept the
Freescale/NXP GPU and VPU licence for an i.MX6 board.

Tested build targets for the yocto bsp are:
	bitbake phytec-headless-image
	bitbake phytec-qt5demo-image

xxx@debian8:~/bsp/temp/BSP-Yocto-Vendor-phyBOARD-Segin-PD17.1.2/build$

然后编辑 conf/local.conf 文件的第一行的 MACHINE 变量,它的值可以通过查看下载网站中这个压缩包位置的machines.txt来查看,如:

http://download.phytec.cn/i.MX6UL/BSP-Yocto-Vendor-phyBOARD-Segin-PD17.1.2/machines.txt

Supported HW
============
在local.conf中填写的机器名    产品的订货号                                                      配置
machines                      article numbers                                                description                                                                                 
========                      ===============                                                ===========                                                                                 
phyboard-segin-imx6ul-2       PB-02013-001.A2, PB-02013-110I.A2, PCL-063-23300CI.A2          PHYTEC phyBOARD-Segin i.MX6 UltraLite, 512MB RAM, NAND                     
phyboard-segin-imx6ul-3       PB-02013-002.A2, PB-02013-001C.A2, PCL-063-11600CC.A2          PHYTEC phyBOARD-Segin i.MX6 ULL, 256MB RAM, 128 NAND                         

比如i.MX6ul的Segin开发板配的核心板是:

MACHINE ?= "phyboard-segin-imx6ul-2"

DISTRO ?= "yogurt"
......

接下来就可以开始编译了,一般我们有两种image可以选

image名称简介
phytec-headless-image
”无头“不带图形界面(一般是QT)的镜像
phytec-qt5demo-image
带图形界面且有一个QT demo的镜像

下面就可以开始编译:

bitbake phytec-headless-image

编译过程根据机器的不同而不同,一般是需要12小时左右,编译完成后可以在build/deploy/机器名/下看到编译的结果:

build/deploy/images/机器名/ 下的文件名描述
barebox.binbootloader
zImage内核
zImage-[....].dtb设备树
phytec-[...]-image-[machine name].ubifsubifs格式的文件系统
phytec-[...]-image-[machine name].sdcardSD卡镜像
phytec-[...]-image-[machine name].tar.gz文件系统压缩包
zImage.config内核config文件
barebox.configbootloader config文件

注意以上文件很多是符号链接,你可以用ls指令来查看真正的文件是哪一个,当然一般不需要这样做。

编译有可能会报各种错误总结如下:

问题解决方法
ERROR: xxxxx do_fetch: Network access disabled through BB_NO_NETWORK修改build/conf/site.conf,去掉BB_NO_NETWORK
binutil/cross-arm/qtwebkit 在链接/编译时报错,log文件可能会提示file trunked由于这几个软件比较大,编译时(尤其链接时)需要很多内存,如内存不够就会出错。
提示imx6-vpu没有人提供(nothing provide)按照本文之前的方法修改conf/local.conf文件
/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory
ERROR: glibc-locale-2.27-r0 do_package: QA Issue: glibc-locale: Files/directories were installed but not shipped in any package

检查 local.conf文件,请使用下面的方法增加qt widgets支持

为QT增加widget支持 / Add widget support for QT
其他错误
  • 再次运行编译指令
  • 按照下面描述的方法复位编译环境

Yocto 参考文档

在yocto中主要是使用bitbake,请参考以下文档

https://elinux.org/Bitbake_Cheat_Sheet

https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html

https://community.nxp.com/docs/DOC-94953

离线BSP包存在的问题

BSP包中有些.git文件夹中的内容是损坏的,因此不能使用git来管理,这样造成了一些麻烦。

可以先记下git的版本号,然后重新从 git.phytec.de 上clone,然后再checkout到对应的版本。

具体的git版本号可以从 https://git.phytec.de/phy2octo/ 来查找对应的BSP版本来查看。

phyLinux编译方法

使用phylinux这个脚本来安装BSP,这个方法需要从很多国外的服务器下载源代码。

但由于repo工具被限制的原因,需要对phylinux这个脚本做一些修改,请按照下面的教程来修改。

phylinux 使用指南 / phylinux guide

其中某些开发板可能会用到repo工具

repo工具使用方案 / repo guide

复位BSP编译环境

1,使用bitbake命令清理

bitbake world -c cleanall -k

清理所有recipe中的编译产物,恢复到初次编译时的状态。

2,直接删除文件夹

在编译环境的build目录中,有以下几个目录

目录名用途复位时删除
buildhistory
cache
confBSP的本地配置文件保留
deploy编译生成的结果,镜像/sdk等
downloads部分编译需要的源码包/git clone推荐保留
sstate-cache编译的缓存,同样的内容只编译一次,可大幅度的加快编译推荐保留
tmp编译的中间结果,如源代码,obj,等等

如果编译出现奇怪的错误,请把上面备注可删除的文件夹删除,然后再重新编译,由于已经编译了一遍,第二次会快很多。

去掉联网限制

如果你需要对BSP做修改,或者增加额外的软件包,你就需要让BSP联网。修改 conf/site.conf 去掉 BB_NO_NETWORK.。该选项的存在会导致在BSP需要联网下载软件包时失败。

OURCE_MIRROR_URL = "file://${TOPDIR}/../src_mirror"
INHERIT += "own-mirrors"
BB_GENERATE_MIRROR_TARBALLS = "1"
SCONF_VERSION = "1"
BB_NO_NETWORK = "1"				<-- 去掉这一行

但有可能由于网络的限制,导致从外网下载失败,此时请使用VPN等工具来解决。

  • No labels