用Yocto Project建立樹莓派2的最小映像檔

若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。

Host OS: 14.04.1-Ubuntu x86_64

安裝Yocto Project所需的套件:
sudo apt-get install sed wget cvs subversion git-core coreutils \
     unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk \
     python-pysqlite2 diffstat help2man make gcc build-essential \
     g++ desktop-file-utils chrpath libgl1-mesa-dev libglu1-mesa-dev \
     mercurial autoconf automake groff
下載Yocto ProjectRaspberry Pi meta layer
mkdir rpi2
cd rpi2
git clone git://git.yoctoproject.org/poky.git
cd poky
git clone git://git.yoctoproject.org/meta-raspberrypi
環境設定:
. ./oe-init-build-env build



修改local.conf
nano conf/local.conf


增加下面兩行(如下圖):
MACHINE ??= "raspberrypi2"
GPU_MEM = "16"

修改bblayers.conf
nano conf/bblayers.conf


增加下面一行(如下圖):
<strong>  /home/jaufranc/edev/rpi/yocto/poky/meta-raspberrypi \</strong>


產生映像檔:
bitbake rpi-basic-image

映像檔寫入SD Card
sudo dd if=tmp/deploy/images/raspberrypi2/rpi-basic-image-raspberrypi2.rpi-sdimg | pv | sudo dd of=/dev/sdX bs=16M

參考資料:
[1] Introduction to Yocto Project - Let's make customized embedded linux
[2] Build a Raspberry Pi 2 Minimal Image with The Yocto Project

沒有留言:

張貼留言