「Raspberry Pi活用/Yocto設定」の版間の差分
ナビゲーションに移動
検索に移動
(→ビルド) |
(→ビルド) |
||
9行目: | 9行目: | ||
~/yocto/poky$ git checkout kirkstone |
~/yocto/poky$ git checkout kirkstone |
||
//~/yocto/poky$ git checkout scarthgap |
//~/yocto/poky$ git checkout scarthgap |
||
~/yocto/poky$ |
~/yocto/poky$ git clone git://git.yoctoproject.org/meta-raspberrypi |
||
~/yocto$ |
~/yocto/poky$ cd meta-raspberrypi |
||
~/yocto |
~/yocto/poky/meta-raspberrypi$ git checkout kirkstone |
||
~/yocto/meta-raspberrypi$ |
~/yocto/poky/meta-raspberrypi$ cd ../.. |
||
~/yocto/meta-raspberrypi$ cd .. |
|||
~/yocto$ . poky/oe-init-build-env |
~/yocto$ . poky/oe-init-build-env |
||
~/yocto/build$ bitbake-layers add-layer ../meta-raspberrypi |
~/yocto/build$ bitbake-layers add-layer ../poky/meta-raspberrypi |
||
</nowiki> |
</nowiki> |
||
2024年5月22日 (水) 15:01時点における版
ビルド
//~/yocto$ git clone -b kirkstone git://git.yoctoproject.org/poky //~/yocto$ . poky/oe-init-build-env //~/yocto/build$ bitbake-layers layerindex-fetch meta-raspberrypi -b kirkstone ~/yocto$ git clone git://git.yoctoproject.org/poky ~/yocto$ cd poky ~/yocto/poky$ git checkout kirkstone //~/yocto/poky$ git checkout scarthgap ~/yocto/poky$ git clone git://git.yoctoproject.org/meta-raspberrypi ~/yocto/poky$ cd meta-raspberrypi ~/yocto/poky/meta-raspberrypi$ git checkout kirkstone ~/yocto/poky/meta-raspberrypi$ cd ../.. ~/yocto$ . poky/oe-init-build-env ~/yocto/build$ bitbake-layers add-layer ../poky/meta-raspberrypi
~/yocto/build/conf/local.conf
MACHINE ?= "raspberrypi4-64"
~/yocto/build$ bitbake core-image-minimal ~/yocto/build$ bitbake core-image-sato -c clean ~/yocto/build$ bitbake core-image-sato ~/yocto/build$ bitbake core-image-sato -c listtasks
$ sudo bmaptool copy core-image-minimal-raspberrypi4-64.wic.bz2 /dev/SDX //$ sudo bmaptool copy core-image-sato-raspberrypi4-64.wic.bz2 /dev/SDX
bitbake-layers show-layers
部分ビルド
$ bitback myapp $ bitback -c cleansstate myapp
<nowki>
build/tmp/work/x86-64-linux/openssl-native/1.0.2o-r0/temp$ ./run.do_compile </nowiki>
qemu
$ runqemu qemu86-64 nographic
SDK
~/yocto/build$ bitbake core-image-sato -c populate_sdk //~/yocto/build$ bitbake meta-toolchain
~/yocto/build/tmp/deploy/sdk/poky-glibc-x86_64-core-image-sato-cortexa72-raspberrypi4-64-toolchain-4.0.17.sh
$ . /opt/poky/4.0.17/environment-setup-cortexa72-poky-linux
$ pkg-config --list-all
ダウンロード
local.conf
DL_DIR ?= "${TOPDIR}/downloads"
自作アプリの追加
デバッグ
git clone -b kirkstone https://git.openembedded.org/meta-openembedded bitbake-layers add-layer meta-oe bitbake-layers add-layer meta-python
local.conf
CORE_IMAGE_EXTRA_INSTALL += " python3 apache2 gdb gdbserver" DISTRO_FEATURES += " debuginfod"
debuginfod
local.conf
gdb /bin/cat
ホスト
oe-debuginfod
gdbserver
local.conf
IMAGE_GEN_DEBUGFS = "1" IMAGE_FSTYPES_DEBUGFS = "tar.bz2" EXTRA_IMAGE_FEATURES:append = " tools-debug"
mkdir debugfs cd debugfs tar xjf build/tmp/deploy/images/qemuarm64/core-image-minimal-qemuarm64.rootfs.tar.bz2 tar xjf build/tmp/deploy/images/qemuarm64/core-image-minimal-qemuarm64.rootfs-dbg.tar.bz2
build-dir/tmp/sysrootfs/host/usr/bin/architecture/architecture-gdb
gdbserver localhost:1234 /bin/gzip -help
cd debugfs aarch64-poky-linux-gdb (gdb) set sysroot debugfs (gdb) set substitute-path /usr/src/debug debugfs/usr/src/debug (gdb) target remote IP-of-target:1234
~/.gdbinit
bitback bash bitbake -c devshell bash cd .. scp packages-split/bash/bin/bash target:/bin/bash cp -a packages-split/bash-dbg/* path/debugfs
ターゲット上でのみデバッグ
local.conf
EXTRA_IMAGE_FEATURES:append = " tools-debug" IMAGE_INSTALL:append = " packagename-dbg" EXTRA_IMAGE_FEATURES:append = " dbg-pkgs" DEBUG_BUILD = "1"
USBブート
local.conf
CMDLINE_remove = "root=/dev/mmcblk0p2" CMDLINE_append = "root=/dev/sda2"