1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Yoctoでqemu用のイメージを作ったけど失敗してやり直した話

Posted at

やったこと(image 作成、qemu実行)

以下のような事を実施しました。

$ git clone -b dunfell git://git.yoctoproject.org/poky.git
$ cd poky
$ source oe-init-build-env build001
$ bitbake core-image-minimal
 # 実行途中なんだけど、CTRL + Cで強制終了
$ bitbake core-image-minimal # 後日再度実行
$ runqemu tmp/deploy/images/qemux86-64/

実行した結果が以下。
ログインしようとしたら "getty: tty1: can't execute '/bin/login'" と出る。

image.png

原因(推測)

おそらく、 "bitbake core-image-minimal" を途中で強制終了したのが原因と思う。

$ git clone -b dunfell git://git.yoctoproject.org/poky.git
$ cd poky
$ source oe-init-build-env build001
$ bitbake core-image-minimal
 # 実行途中なんだけど、CTRL + Cで強制終了
$ bitbake core-image-minimal # 後日再度実行
$ runqemu tmp/deploy/images/qemux86-64/

やり直す。でも少しラクをしたい。

最初、以下のようにしようかとも考えました。
ただこれだと、一回目と同じくらい時間がかかる。
それは嫌だ。

$ source oe-init-build-env build002 # 新しくbuild002 を作成 
$ bitbake core-image-minimal
$ runqemu tmp/deploy/images/qemux86-64/

一回目のダウンロードしたコードを流用する

一回目のbitbake コマンド実行時にダウンロードしたコード一式は
そのまま利用できるだろうと考え(さすがにここはおかしくなってないだろうと推測)、流用することに。

以下のように conf/local.conf で DL_DIR変数にパスを設定

conf/local.conf
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
DL_DIR ?= "/home/username/yocto/poky/build001/downloads"

参考:https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-DL_DIR

再度実行(ダウンロードしたコードは流用して)

ということで、再実行ときに実施した手順は以下。

$ source oe-init-build-env build002 # 新しくbuild002 を作成 
$ vim conf/local.conf # DL_DIRにパスを設定
$ bitbake core-image-minimal
$ runqemu tmp/deploy/images/qemux86-64/

実行した結果は以下。無事 loginできました。

image.png

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?