petalinux-devtool の例 - 2023.1 日本語

PetaLinux ツール資料: リファレンス ガイド (UG1144)

Document ID
UG1144
Release Date
2023-05-16
Version
2023.1 日本語

ワークスペース レイヤーへの新しいレシピの追加

ワークスペース レイヤーに新しいレシピを追加するには、petalinux-devtool add コマンドを使用します。petalinux-devtool add bbexample https://github.com/whbruce/bbexample.git の場合、このコマンドは、指定された URL からソースをフェッチし、devtool ワークスペース ディレクトリにレシピ bbexample を作成します。

petalinux-devtool add
petalinux-devtool add bbexample https://github.com/whbruce/bbexample.git
[INFO] Sourcing buildtools
[INFO] Extracting yocto SDK to components/yocto. This may take time!
[INFO] Generating Kconfig for project
[INFO] Silentconfig project
[INFO] Generating kconfig for rootfs
[INFO] Silentconfig rootfs
[INFO] Adding user layers
[INFO] Generating machine conf file
[INFO] Generating plnxtool conf file
[INFO] Generating kernel configuration files
[INFO] Generating u-boot configuration files
[INFO] Generating workspace directory
[INFO] devtool add bbexample https://github.com/whbruce/bbexample.git 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-ac701-2023.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:34447, PID: 23551
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-ac701-2023.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:34939, PID: 23680
INFO: Fetching git://github.com/whbruce/bbexample.git;protocol=https;branch=master...
Loading cache: 100% |                                                       | ETA:  --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |######################################################| Time: 0:00:24
Parsing of 4359 .bb files complete (0 cached, 4359 parsed). 6290 targets, 863 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Fetching uninative binary shim file://xilinx-ac701-2023.1/components/yocto/downloads/uninative/5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab971c934e0b803bcc00/x86_64-nativesdk-libc-3.8.1.tar.xz;sha256sum=5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab971c934e0b803bcc00 (will check PREMIRRORS first)
Initialising tasks: 100% |###################################################| Time: 0:00:00
Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0% complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and all succeeded.
INFO: Using default source tree path xilinx-ac701-2023.1/components/yocto/workspace/sources/bbexample
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Reconnecting to bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Retrying server connection (#1)...
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-ac701-2023.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:43239, PID: 26161
INFO: Recipe xilinx-ac701-2023.1/components/yocto/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional


petalinux-devtool status
[INFO] Sourcing buildtools
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
[INFO] devtool status 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-ac701-2023.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:37885, PID: 30764
bbexample: xilinx-ac701-2023.1/components/yocto/workspace/sources/bbexample (xilinx-ac701-2023.1/components/yocto/workspace/recipes/bbexample/bbexample_git.bb)

ワークスペース内のレシピのステータスの取得

現在ワークスペースにあるレシピのリストを表示するには、petalinux-devtool status コマンドを使用します。情報には、各レシピの外部ソース ツリーへのパスが含まれます。

petalinux-devtool status
petalinux-devtool status
[INFO] Sourcing buildtools
[INFO] Sourcing build environment
[INFO] Generating workspace directory
[INFO] devtool status 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup/project/_20221015_/xilinx-ac701-2022.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:39075, PID: 29287
bbexample: /wrk/everest_fcv_nobkup/project/_20221015_/xilinx-ac701-2022.2/components/yocto/workspace/sources/bbexample (/wrk/everest_fcv_nobkup/project/_20221015_/xilinx-ac701-2022.2/components/yocto/workspace/recipes/bbexample/bbexample_git.bb)

既存のレシピの変更

既存レシピのソースの変更を開始するには、petalinux-devtool modify コマンドを使用します。このコマンドは、レシピのソースを devtool ワークスペース ディレクトリに解凍し、開発用のブランチをチェックアウトし、レシピからのパッチ (存在する場合) を適用します。

linux-xlnx レシピを変更するには、次のコマンドを実行します。

petalinux-devtool modify linux-xlnx
図 1. petalinux-devtool modify

レシピのビルド

レシピをビルドするには、petalinux-devtool build コマンドを使用します。このコマンドは bitbake -c populate_sysroot コマンドと同等です。次に示すように、レシピのルート名を指定する必要があります (つまり、バージョン、パス、拡張子は指定しない)。

petalinux-devtool build linux-xlnx
図 2. petalinux-devtool build

イメージのビルド

devtool フローを使用してイメージをビルドするには、petalinux-devtool build-image コマンドを使用します。これにはワークスペース ディレクトリであるレシピが含まれます。このコマンドを実行する場合は、ビルドされるイメージ名を指定する必要があります。

petalinux-devtool build-image petalinux-image-minimal
図 3. petalinux-devtool build-image

レシピのリセット

devtool ワークスペース ディレクトリからレシピとその設定を削除するには、petalinux-devtool reset コマンドを使用します。このコマンドはどのレイヤーにも devtool ワークスペース内の変更を加えません。reset コマンドを実行する前に、レシピの append ファイルをアップデートする必要があります。

petalinux-devtool reset linux-xlnx
図 4. petalinux-devtool reset
注記: 例のリストは、https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-devtool-reference にあります。例の devtool の代わりに必ず petalinux-devtool を使用してください。