📘
Yocto Linux で tmp/deploy/images/ 以下を再生成する
Background
build/tmp/deploy/images
以下にはカーネルやユーザランドのイメージファイルが生成される。ディスク掃除の一環でそれらを消したあとに runqemu すると以下のようなエラーが出る。
$ runqemu
runqemu - INFO - Running bitbake -e ...
ls: cannot access '/home/tomoki/poky/build/tmp/deploy/images/qemux86-64/*.qemuboot.conf': No such file or directory
runqemu - ERROR - Command 'ls -t /home/tomoki/poky/build/tmp/deploy/images/qemux86-64/*.qemuboot.conf' returned non-zero exit status 2.
runqemu - INFO - Cleaning up
runqemu - INFO - Host uptime: 449.42
$ runqemu
runqemu - INFO - Running bitbake -e ...
runqemu - ERROR - KERNEL not found: /home/tomoki/poky/build/tmp/deploy/images/qemux86-64/${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "bzImage-${INITRAMFS_LINK_NAME}.bin", "bzImage", d)}, /home/tomoki/poky/build/tmp/deploy/images/qemux86-64/bzImage or /home/tomoki/poky/build/tmp/deploy/images/qemux86-64/bzImage*
runqemu - INFO - Cleaning up
runqemu - INFO - Host uptime: 155.84
このとき bitbake をしても再生成がされなくて困る。
$ bitbake core-image-sato
WARNING: Host distribution "ubuntu-24.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |########################################################################################################################################| Time: 0:00:00
Loaded 3129 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "2.6.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "x86_64-poky-linux"
MACHINE = "qemux86-64"
DISTRO = "poky"
DISTRO_VERSION = "4.3.4"
TUNE_FEATURES = "m64 core2"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "my-nanbield:7b8aa378d069ee31373f22caba3bd7fc7863f447"
meta-oe = "nanbield:da9063bdfbe130f424ba487f167da68e0ce90e7d"
WARNING: /home/tomoki/poky/meta/recipes-kernel/linux/linux-yocto_6.5.bb:do_compile is tainted from a forced run | ETA: 0:00:01
WARNING: /home/tomoki/poky/meta/recipes-sato/images/core-image-sato.bb:do_build is tainted from a forced run
Initialising tasks: 100% |###################################################################################################################################| Time: 0:00:03
Sstate summary: Wanted 1 Local 0 Mirrors 0 Missed 1 Current 4358 (0% match, 99% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 8834 tasks of which 8834 didn't need to be rerun and all succeeded.
Summary: There were 3 WARNING messages.
対処方法
clean してからもう一度 bitbake すれば大丈夫。ビルドは走らない。
$ bitbake linux-yocto -c clean
$ bitbake core-image-sato -c clean
$ bitbake core-image-sato
ちなみに clean は以下のように説明されている。
$ bitbake linux-yocto -c listtasks
...
do_clean Removes all output files for a target
do_cleanall Removes all output files, shared state cache, and downloaded source files for a target
...
Discussion