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 "





0 件のコメント:

コメントを投稿