LoginSignup
0
2

More than 3 years have passed since last update.

yocto recipeの作成方法

Last updated at Posted at 2019-09-03
  • yocto-layer createでひな型作成 →カレントディレクトリにmeta-my-recipeディレクトリが生成される
. ./pokyscripts/yocto-layer create my-recipe
Please enter the layer priority you'd like to use for the layer: 6
Would you like to have an example receipe created?(y/n) y
Please enter the name you'd like to use for your example recipe: [default example]
Would you like to have an exmple bbappend the created?(y/n): n

New layer created in meta-recipes.
  • recipe説明
SUMMARY = "hogihogi Initialization"      # recipe概要
SECTION = "hogihogi"                     # recipeが所属するセクション(一応ビルド時にチェックされる)
LICENSE = "CLOSED"                       # ライセンス名
LIC_FILES_CHKSUM = "file://COPYING;md5=ffffffffffffffffffffffff"# ファイル名+md5
PR = "r0"                                     # Recipeのリビジョン
SRC_URI = "file://hogihogi.sh"              # ソーファイル定義
#inherit systemd update-rc.d

nvngから起動するため、rcS.d配下へのシンボリックリンク生成は行わない

INITSCRIPT_NAME = "hogighogi.sh"              
INITSCRIPT_PARAMS = "start 90 S . stop 90 ."   

do_install() {                                # タスク定義(実際に実行されるタスクはbitbake -c listtasks レシピ名で確認できる)
    install -d ${D}${sysconfdir}/init.d       # do_instllはmake installを実行
    install -m 0755 ${WORKDIR}/hogihogi.sh ${D}${sysconfdir}/init.d/hoighogi.sh
}

# タスクは上書き、追加可能
# タスク間は依存関係がある
# 自作のタスクを定義可能

PACKAGES = "hogihogi-init"
FILES_${PN} = "${sysconfdir}/init.d/hogihogi.sh"
  • recipeのビルド

    1. meta-my-recipesのパスをbblayers.confのBBLATERSに追加する
    2. bitbake-layers show-layersでビルド環境レイヤーをチェックする
    3. bitbake exampleを実行
  • 既存のrecipeのビルド方法

    1. .bbを直接変更しない
    2. ddappendファイルを作成して上書き
    3. .bbappendファイルを上書きするときはレシピ名(PN)とレシピのバージョン(PV)が同じである必要がある

<参考>
https://www.slideshare.net/iwamatsu/ss-31662659
https://qiita.com/propella/items/8d861d08c95ac08136d2

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2