Yocto BSP 开发说明

Yocto BSP 开发说明

内容参考:http://www.yoctoproject.org/docs/2.0/bsp-guide/bsp-guide.html#bsp

简介:

一个BSP(BoardSupport Package)  定义了如何去支持一个或者一类特定的硬件设备,或者硬件平台.

1 BSP layers:

BSP layers 的命名: meta-bsp_name, 如meta-minnow, meta-raspberrypi, and meta-intel .
源码来源: http://git.yoctoproject.org/cgit/cgit.cgi
 
git clone git://git.yoctoproject.org/meta-minnow
 
向conf/bblayers.conf: BBLAYERS 添加BSP的layers 路径
 

2 从文件组织来说明BSPlayers

下面是可能存在差异的文件列表:

     meta-bsp_name/
     meta-bsp_name/bsp_license_file
     meta-bsp_name/README
     meta-bsp_name/README.sources
     meta-bsp_name/binary/bootable_images
     meta-bsp_name/conf/layer.conf
     meta-bsp_name/conf/machine/*.conf
     meta-bsp_name/recipes-bsp/*
     meta-bsp_name/recipes-core/*
     meta-bsp_name/recipes-graphics/*
     meta-bsp_name/recipes-kernel/linux/linux-yocto_kernel_rev.bbappend

下面是eMenlow的文件列表:

     meta-emenlow/COPYING.MIT
     meta-emenlow/README
     meta-emenlow/README.sources
     meta-emenlow/binary/
     meta-emenlow/conf/
     meta-emenlow/conf/layer.conf
     meta-emenlow/conf/machine/
     meta-emenlow/conf/machine/emenlow-noemgd.conf
     meta-emenlow/recipes-bsp/
     meta-emenlow/recipes-bsp/formfactor/
     meta-emenlow/recipes-bsp/formfactor/formfactor/
     meta-emenlow/recipes-bsp/formfactor/formfactor_0.0.bbappend
     meta-emenlow/recipes-bsp/formfactor/formfactor/emenlow-noemgd/
     meta-emenlow/recipes-bsp/formfactor/formfactor/emenlow-noemgd/machconfig
     meta-emenlow/recipes-graphics/
     meta-emenlow/recipes-graphics/xorg-xserver
     meta-emenlow/recipes-graphics/xorg-xserver/xserver-xf86-config
     meta-emenlow/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
     meta-emenlow/recipes-graphics/xorg-xserver/xserver-xf86-config/emenlow-noemgd
     meta-emenlow/recipes-graphics/xorg-xserver/xserver-xf86-config/emenlow-noemgd/xorg.config
     meta-emenlow/recipes-kernel/
     meta-emenlow/recipes-kernel/linux/
     meta-emenlow/recipes-kernel/linux/linux-yocto-dev.bbappend
     meta-emenlow/recipes-kernel/linux/linux-yocto_3.14.bbappend

 

2.1  License Files

meta-bsp_name/bsp_license_file

eMenlow 的license 文件是COPYING.MIT.

还可以是MIT,BSD, GPLv* 等等.

2.2  README 

meta-bsp_name/README , 它需要提供如何启动的方法,最少也得包含依赖关系和联系方式.

2.3. README.sources

meta-bsp_name/README.sources , 它提供了BSP源代码的存储路径和来源地址.

2.4. Pre-built User Binaries

meta-bsp_name/binary/bootable_images , 存储了已经编译好的二进制kernelrootfs.

2.5. Layer Configuration File

meta-bsp_name/conf/layer.conf ,下面是模版,需要用真实的名字替换掉bsp.
     # We have a conf and classes directory, add to BBPATH
     BBPATH .= ":${LAYERDIR}"
 
     # We have a recipes directory, add to BBFILES
     BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
             ${LAYERDIR}/recipes-*/*/*.bbappend"
 
     BBFILE_COLLECTIONS += "bsp"
     BBFILE_PATTERN_bsp = "^${LAYERDIR}/"
     BBFILE_PRIORITY_bsp = "6"
 
     LAYERDEPENDS_bsp = "intel"

2.6. Hardware Configuration Options

meta-bsp_name/conf/machine/*.conf

硬件的配置信息.

2.7. Miscellaneous BSP-Specific Recipe Files

meta-bsp_name/recipes-bsp/*

包含一些BSP特定的package.

2.8. Display Support Files

meta-bsp_name/recipes-graphics/*

它可以代表一类可以运行在该BSP上的package.

2.9. Linux Kernel Configuration

meta-bsp_name/recipes-kernel/linux/linux-yocto*.bbappend

它可以配置kernel信息.

3 发布BSP的需求和推荐

3.1. Released BSP Requirements

在GIT上发布一个BSP,我们需要严格按照BSP的书写格式填写相关的文件.

3.2. Released BSP Recommendations

发布BSP的可选项:  可启动的bootimage 以及 一个特定的yoctokernel recipes.

4 自定义一个BSP的recipe

在”xyz”中定义一个BSP相关的interfaces工具基于init-ifupdown_1.0.bb.

·       编辑init-ifupdown_1.0.bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

·       建立interfaces的存储位置

meta-xyz/recipes-core/init-ifupdown/files/xyz-machine-one/interfaces

如果BSP只支持一个硬件机器,可以改为: meta-xyz/recipes-core/init-ifupdown/files/interfaces

5 BSP的Licensing考虑事项

6 使用Yocto的BSP 工具

Yocto 工程已经包含了一系列的BSP 工具 : yocto-bsp 和  yocto-kernel .

6.1. Common Features

$ source oe-init-build-env build_dir
$ yocto-bsp help
$ yocto-bsp help create

6.2. 通过yocto-bsp工具创建BSPlayers

$ yocto-bsp list karch
     Architectures available:
         qemu
         mips64
         powerpc
         x86_64
         arm
         mips
         i386
$ yocto-bsp create myarm qemu
     Checking basic git connectivity...
     Done.
     Which qemu architecture would you like to use? [default: i386]
         1) i386    (32-bit)
         2) x86_64  (64-bit)
         3) ARM     (32-bit)
         4) PowerPC (32-bit)
         5) MIPS    (32-bit)
         6) MIPS64  (64-bit)
     3
     Would you like to use the default (3.19) kernel? (y/n) [default: y] y
     Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y]
     Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.19.git...
     Please choose a machine branch to base your new BSP branch on: [default: standard/base]
         1) standard/arm-versatile-926ejs
         2) standard/base
         3) standard/beagleboard
         4) standard/beaglebone
         5) standard/ck
         6) standard/common-pc
         7) standard/crownbay
         8) standard/edgerouter
         9) standard/fsl-mpc8315e-rdb
         10) standard/mti-malta32
         11) standard/mti-malta64
         12) standard/qemuarm64
         13) standard/qemuppc
     1
     Would you like SMP support? (y/n) [default: y]
     Does your BSP have a touchscreen? (y/n) [default: n]
     Does your BSP have a keyboard? (y/n) [default: y]
     New qemu BSP created in meta-myarm

6.3. 通过yocto-kernel工具管理KernelPatches and Config

$ yocto-kernel --help
$ yocto-kernel patch add myarm ~/test.patch
     Added patches:
       test.patch
 
$ yocto-kernel patch add myarm ~/yocto-testmod.patch
     Added patches:
       yocto-testmod.patch
$ yocto-kernel patch list myarm
     The current set of machine-specific patches for myarm is:
       1) test.patch
       2) yocto-testmod.patch
$ yocto-kernel patch rm myarm
     Specify the patches to remove:
       1) test.patch
       2) yocto-testmod.patch
     1
     Removed patches:
       test.patch
$ yocto-kernel patch list myarm
     The current set of machine-specific patches for myarm is:
1)  yocto-testmod.patch
 
 
$ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y
     Added item:
       CONFIG_MISC_DEVICES=y
 
     $ yocto-kernel config add myarm CONFIG_YOCTO_TESTMOD=y
     Added item:
       CONFIG_YOCTO_TESTMOD=y
$ yocto-kernel config list myarm
     The current set of machine-specific kernel config items for myarm is:
             1) CONFIG_MISC_DEVICES=y
             2) CONFIG_YOCTO_TESTMOD=y
$ yocto-kernel config rm myarm CONFIG_MISC_DEVICES=y

 

 

 

 

你可能感兴趣的:(Yocto)