Yocto Raspberry Pi 2

提供: KiyomiWiki
移動: 案内検索

1. install the devtools.

$ sudo apt-get install git diffstat texinfo gawk chrpath


2.First you need to get poky and the meta layer for Raspberry Pi:

$ mkdir yocto
$ cd yocto
$ git clone -b jethro git://git.yoctoproject.org/poky.git
$ cd poky
$ git clone git://git.yoctoproject.org/meta-raspberrypi

3.Then you can run the following command line to initialize some environment variables and the build directory:

$ ~/yocto
$ . poky/oe-init-build-env build


4. Modify conf/local.conf

MACHINE ?= "raspberrypi2"
GPU_MEM = "16"


5. Modify conf/bblayers.conf

BBLAYERS ?= " \
 /home/ubuntu/yocto/poky/meta \
 /home/ubuntu/yocto/poky/meta-yocto \
 /home/ubuntu/yocto/poky/meta-yocto-bsp \
 /home/ubuntu/yocto/poky/meta-raspberrypi \
"

6. Build the image

$ bitbake rpi-basic-image

7. Write to SD Card (sd = /dev/sdb)

$ sudo dd if=tmp/deploy/images/raspberrypi2/rpi-basic-image-raspberrypi2.rpi-sdimg of=/dev/sdb bs=16M
$ sync

URL: http://www.cnx-software.com/2015/02/27/yocto-project-raspberry-pi-2-board-minimal-image/


参考:kernelソースコードの展開ディレクトリ

~/yocto/build/tmp/work/raspberrypi2-poky-linux-gnueabi/linux-raspberrypi/1_4.1.21+\
gitAUTOINC+ff45bc0e89-r0/linux-raspberrypi2-standard-build/source

toolchain

1. build sdk

$ cd yocto
$ source ./pokey/oe-init-build-env
$ bitbake rpi-basic-image -c populate_sdk

2. install sdk

$ cd tmp/deploy/sdk
$ sudo ./poky-glibc-x86_64-rpi-basic-image-cortexa7hf-neon-vfpv4-toolchain-2.3.2.sh

3. use sdk (sample wpa_supplicant 2.5)

$ source /opt/poky/2.3.2/environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi
$ cd wpa_supplicant-2.5/wpa_supplicant
$ cp defconfig .config
$ echo "CONFIG_LIBNL32=y" >> .config
$ make