0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SoDeVとは、 Automotive Grade Linux(AGL)から2025年12月5日に発表された、SDVのオープンソースによるリファレンスプラットフォームです。
参考:AGLからのリリース(英語)、LFからのリリース(日本語)

次世代SDVをオープンソースで実感および開発することができます。
今回はGitHubで公開されているソースコードのビルドをイチからやってみました。
https://github.com/automotive-grade-linux/sodev-demo-workspace

2026年4月上旬に実施しました。UbuntuやSoDeVの更新によって必要な設定・パッケージは変わるかもしれないので、一旦参考程度で。もしうまくいかなければコメントしていただければと思います。

流れは以下になります。

  1. x86アーキでのUbuntuサーバー構築
  2. Ubuntuサーバーへのビルド環境設定
  3. ビルド

1. x86アーキでのUbuntuサーバー構築

まずはビルドマシンを作ります。
今回、去年買ったIntel Core Ultra 155U(12コア)32GB RAMのノートPCと1TBの外付けUSB-HDDを使用しました。
完了まで40時間ほどかかったので、ちゃんとビルドマシンだと言えるような高性能な環境を用意すべきだと思います。

1x年前のジャンクノートPC(4コア、4GB RAM)ではビルド完了まで至れませんでした…

Rufus で作ったUSBメモリインストーラでUbuntu Server の24.04.4LTSをUSB-HDDにインストールしました。
なおストレージは、一発ビルドするだけであれば1TBでも大丈夫でしたが、ぎりぎりだったので開発するなら2TBほど用意したほうが良いと思います。

2. Ubuntuサーバーへのビルド環境設定

ビルドエラーさせて対処して…を繰り返した結果、必要となった設定をまとめています。

まず必要なパッケージをインストールします。(不要なものも含んでいるかもしれません。)

$ sudo apt update
$ sudo apt install -y \
build-essential chrpath cpio debianutils diffstat file gawk gcc git \
iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 \
python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils \
zstd curl ninja-build bmap-tools repo python3.12-venv zip meson \
python3-setuptools pkg-config libcurl4-openssl-dev libdrm-dev libv4l-dev \
python3-mako byacc bison flex android-sdk-libsparse-utils

gitコマンドを実行するためのユーザーアカウントの設定を入れます。メアドと名前はご自身のを設定するといいと思います。

$ git config --global user.email "your.email@example.com"
$ git config --global user.name "Your Name"

Ubuntuがデフォルトで制限しているuser namespaceの作成制限を解除します。

$ sudo vi /etc/sysctl.d/99-sysctl.conf
# "kernel.apparmor_restrict_unprivileged_userns = 0"をファイル末尾に追記
$ sudo systemctl -p

python仮想環境を作成し、moulinをインストールします。

$ mkdir sodev
$ cd sodev/
$ python3 -m venv moulin_env
$ source moulin_env/bin/activate
$ pip install git+https://github.com/xen-troops/moulin

ビルドが長すぎるせいか時刻のズレが生じるようで、無視するようにしました。

$ export BB_HASH_IGNORE_MISMATCH=1

最後にソースコード一式を取得してビルド準備完了です。

$ git clone --recurse-submodules https://github.com/automotive-grade-linux/sodev-demo-workspace

3. ビルド

ビルドはbuild.shを実行するだけです。

$ cd sodev-demo-workspace/
$ ./build.sh

ネットワークのエラーによりビルド中のダウンロードに失敗するとFetchエラーとして中断されてしまいますが、再度そのままbuild.shを実行することで途中から再開されます。
これを繰り返して、下記のような表示で完了しました。

[INFO] Running dd if=yocto/../../../../agl/build/tmp/deploy/images/virtio-aarch64/agl-cluster-demo-flutter-guest-virtio-aarch64.rootfs.ext4 of=full.img bs=65536 seek=298960 status=progress conv=notrunc conv=sparse
606404608 bytes (606 MB, 578 MiB) copied, 1 s, 606 MB/s
20201+1 records in
20201+1 records out
1323931648 bytes (1.3 GB, 1.2 GiB) copied, 1.851 s, 715 MB/s
[INFO] Done in 0:00:29.990976
[INFO] You can write result to your SD card. Don't forget to pass 'conv=sparse' option to dd. This will improve writing speed greatly.

sodev-demo-workspace配下の以下パスにSDカード等に書き込むfull.imgが生成されています。

external/meta-rcar-demo/work_v4hsbc_xen/full.img

次回予告

今後、使い方や、カスタマイズの仕方を整理してまた記事にしていきたいと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?