raspberrypi2が手に入ったので火入れ。 でも、yoctoでやりたい。
すでにRPi2対応をしている人がいるようす。 とりあえず、rpi-basic-imageをSDに書き込んで起動するところまで頑張ったのでメモ。
環境構築
ファイルの取得
gitでファイルを取得する。
$ cd ~/ $ mkdir rpi2 $ cd rpi2 $ git clone git://git.yoctoproject.org/poky.git $ cd poky $ git clone https://github.com/agherzan/meta-raspberrypi.git ## $ git clone https://github.com/djwillis/meta-raspberrypi.git この行は不要(2/15 編集)
2/15 編集
dwillisさんのミラーは以下のような案内が出ているため取得先を変更しました。
The github mirror was moved to https://github.com/agherzan/meta-raspberrypi This repository is not maintained anymore.
ビルド
以下のコマンドでbulidディレクトリとconfを生成。
$ cd ~/rpi2 $ source poky/oe-init-build-env
自動的にbuildディレクトリに移動される。
conf/bblayers.conf
BBLAYERSにmeta-raspberrypiを追加。
BBLAYERS ?= " \ /home/mickey/rpi2/poky/meta \ /home/mickey/rpi2/poky/meta-yocto \ /home/mickey/rpi2/poky/meta-yocto-bsp \ /home/mickey/rpi2/poky/meta-raspberrypi \ "
conf/local.confの編集
以下を追加
MACHINE ?= "raspberrypi2" BB_NUMBER_THREADS = "8" PARALLEL_MAKE = "-j 8" GPU_MEM = "128" FETCHCMD_wget = "/usr/bin/env wget -t 2 -T 3000 -nv --passive-ftp --no-check-certificate"
MACHINEはraspberrypi2 FETCHCMD_wgetの行はfetchエラー対策。少しは効果あるかな。
bitbake
$ bitbake rpi-basic-image
無事に作れた。
NOTE: Preparing RunQueue NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks NOTE: Tasks Summary: Attempted 1984 tasks of which 1968 didn't need to be rerun and all succeeded. Summary: There was 1 WARNING message shown.
書き込み
これをSDに書き込む。
$ dd if=./tmp/deploy/images/raspberrypi2/rpi-basic-image-raspberrypi2.rpi-sdimg of=/dev/sdb bs=40M
起動
起動する。
コアが4つ認識されてる。
無事ログインできた。
#写真の加工に失敗している。。。