2017年12月13日水曜日

Yocto04-Camera

カメラモジュール旧式(OV5647)が購入

Yoctoの手順をおさらい。これからカメラを組み込む。
1. /home1/poky で source oe-init-build-env build_20171213
  /home1/poky/build_20171213 ができる
    build_20171213/conf ができる
    confの中にbblayers.conf,local.conf,templateconf.cfg ができる
2. local.conf 編集
  MACHINE ??= "qemux86"をコメントアウト
  以下を追加
  MACHINE = "raspberrypi0-wifi"
  DISTRO_FEATURES_append = " bluez5"
  COMBINED_FEATURES_append = " ext2 usbgadget usbhost wifi bluetooth"
  IMAGE_INSTALL_append = " linux-firmware-bcm43430 connman connman-client usbutils sudo local "
  IMAGE_FEATURES_append = " ssh-server-dropbear"
  # host setup
  hostname_pn-base-files = "yoctopi"
  INHERIT_append = " extrausers"
  EXTRA_USERS_PARAMS = "useradd -P XXXX pi;usermod -P XXXX root;"
  BB_NUMBER_THREADS = "8"
  PARALLEL_MAKE = "-j 8"
  DL_DIR ?= "/home1/work/poky/poky-downloads"
3. bblayers.conf 編集
  以下を追加
  /home1/poky/meta-openembedded/meta-oe \
  /home1/poky/meta-openembedded/meta-networking \
  /home1/poky/meta-openembedded/meta-perl \
  /home1/poky/meta-openembedded/meta-python \
  /home1/poky/meta-raspberrypi \
  /home1/poky/meta-local \
4. meta-local はすでにあるのでそのまま
5. build_20171213 でビルド bitbake rpi-hwup-image

Yocto03

connmanctlの設定を追加

local_1.0.bbの中身

変更追加分のみ
SRC_URI = "file://test1.txt file://test2.txt file://0024A5xxxxxx.config file://settings"

do_install(){
  ...
  install -d ${D}/var/lib/connman
  install -m 0644 ${THISDIR}/files/0024A5D90CDF_psk.config ${D}/var/lib/connman
  install -m 0644 ${THISDIR}/files/settings ${D}/var/lib/connman
}
...
FILES_${PN} += "/var/lib/connman/0024A5D90CDF_psk.config"
FILES_${PN} += "/var/lib/connman/settings"

2017年12月2日土曜日

Yocto02

あるファイルをrootfsに組み込む実験

11/19から始めて、2週間。やっと動いた。
テキストファイルtest1を/tmp、test2.txtを/home/rootに置くレシピの作成。

localのレシピを作る

meta-local(D)
+---------conf(D)
| +---------------layer.conf
+---------recipes-local(D)
| +---------------local(D)
| +-------files(D)
| | +-------test1.txt
| | +-------test2.txt
| +-------COPYING.MIT
| +-------local_1.0.bb
+---------README

layer.confの中身

BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "local"
BBFILE_PATTERN_local = "^${LAYERDIR}/"
BBFILE_PRIORITY_local = "7"

local_1.0.bbの中身

DESCRIPTION = "Test 2017-11-xx"
SECTION = "unknown"
PRIORITY = "optional"
MAINTAINER = "xxx "
HOMEPAGE = "http://"
LICENSE = "MIT"
LIC_FILES_CHKSUM="file://${THISDIR}/COPYING.MIT;md5=91203d58fb77b02fc55a900c6263f1ba"
SRC_URI = "file://test.txt file://test2.txt"
do_install(){
  install -d ${D}/tmp
  install -m 0644 ${THISDIR}/files/test1.txt ${D}/tmp
  install -d ${D}/home/root
  install -m 0644 ${THISDIR}/files/test2.txt ${D}/home/root
}
FILES_${PN} += "/tmp/test.txt"
FILES_${PN} += "/home/root/test2.txt"

COPYING.MITの中身

Copyright 2017 H.T

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

test1.txtの中身

This is test1

test2.txtの中身

This is test2

READMEの中身

2017-11-26 new

Buildの変更

build-xxxのconfのlocal.conf

IMAGE_INSTALL_append = " 略 local "