Let's Vitis(8) - PMU Firmwareのビルド

今回はPMU Firmwareをビルドします。

PMU FirmwareはYocto Projectのビルド・フレームワークを使用して生成します。

Yocto Projectの環境は「Let's Vitis(3) - Linuxディストリビューションの構築」で勉強したとおりです。

ビルド環境を整備

次のようにビルド環境を生成します。

$ cd poky
$ source ./oe-init-build-env ../build_pmufw

そうすると、build_pmufwディレクトリに移動しています。

build_pmufwディレクトリにはconfディレクトリが生成されており、デフォルトで次のファイルが用意されています。

  • bblayers.conf
  • local.conf
  • templateconf.cfg

これらのファイルをPMU Firmwareをビルドできるように設定します。

bblayers.conf

bblayers.confはどのメタファイルを使用するかを設定するファイルです。

デフォルトでは次のようになっています。

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/hidemi/yocto/yocto_zeus/poky/meta \
  /home/hidemi/yocto/yocto_zeus/poky/meta-poky \
  /home/hidemi/yocto/yocto_zeus/poky/meta-yocto-bsp \
  "

次のように5つのメタファイルを追加します。

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/hidemi/yocto/yocto_zeus/poky/meta \
  /home/hidemi/yocto/yocto_zeus/poky/meta-poky \
  /home/hidemi/yocto/yocto_zeus/poky/meta-yocto-bsp \
  "

BBLAYERS += " ${TOPDIR}/../sources/meta-openembedded/meta-oe "
BBLAYERS += " ${TOPDIR}/../sources/meta-xilinx/meta-xilinx-bsp "
BBLAYERS += " ${TOPDIR}/../sources/meta-xilinx/meta-xilinx-contrib "
BBLAYERS += " ${TOPDIR}/../sources/meta-xilinx/meta-xilinx-standalone "
BBLAYERS += " ${TOPDIR}/../sources/meta-ultra96 "

local.conf

local.confはどのようなLinuxディストリビューションを構築するかを設定するファイルです。

このファイルに必要なアプリケーションを設定したりします。

デフォルトでは次のようになっています。

#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at local.conf.extended
# which contains other examples of configuration which can be placed in this file
# but new users likely won't need any of them initially.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.

#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
<<<長いので省略>>>
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "1"

これを次のように設定します。

# Machine Selection
MACHINE ??= "zynqmp-pmu"

# Where to place downloads
DL_DIR ?= "${TOPDIR}/../downloads"

# Where to place the build output
TMPDIR="${TOPDIR}/pmutmp"

# Default policy config
DISTRO ?= "xilinx-standalone"
# Extra image configuration defaults
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

# Additional image features
USER_CLASSES ?= "buildstats image-mklibs image-prelink"

# Interactive shell configuration
PATCHRESOLVE = "noop"

# Disk Space Monitoring during the build
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"

# Qemu configuration
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"

# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "1"

#LICENSE = "Proprietary"

ビルド

bblayers.confとlocal.confの設定が完了したらビルドするだけです。

$ bitbake pmu-firmware

ビルドには時間がかかるので気長に待ちましょう。

ビルドが完了するとpmutmpというディレクトリが生成されています。

PMU Firmwareは次のELFファイルです。

pmutmp/deploy/images/zynqmp-pmu/pmu-firmware-zynqmp-pmu.elf

次回予告

次回は「Linuxディストリビューションのビルド」を勉強しましょう。

write: 2020/01/22/ 00:00:00