Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ubuntuのriscv64版をqemuで動かした
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuhiro NISHIYAMA
April 27, 2024
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ubuntuのriscv64版をqemuで動かした
[LILO&東海道らぐオフラインミーティング 2024-04-27](
https://lilo.connpass.com/event/316818/)での発表資料です
。
Kazuhiro NISHIYAMA
April 27, 2024
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Rubyの配布パッケージの変遷
znz
0
23
Headscale + Tailscale に移行中
znz
0
65
Ruby on Rails と私
znz
0
77
riscv64.rubyci.org internal
znz
0
58
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
110
devise-two-factorを4.xから5.xに上げた話
znz
0
430
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
120
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
150
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
130
Other Decks in Programming
See All in Programming
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
280
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
180
Oxcを導入して開発体験が向上した話
yug1224
4
330
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
Agentic UI
manfredsteyer
PRO
0
190
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
120
さぁV100、メモリをお食べ・・・
nilpe
0
150
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
Featured
See All Featured
Side Projects
sachag
455
43k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Scaling GitHub
holman
464
140k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
The Invisible Side of Design
smashingmag
301
52k
GitHub's CSS Performance
jonrohan
1033
470k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
170
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Designing for Performance
lara
611
70k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
540
Transcript
Ubuntuのriscv64版をqemu で動かした Kazuhiro NISHIYAMA LILO&東海道らぐオフラインミーティング 2024-04-27 2024-04-27 Powered by Rabbit
3.0.3
self.introduction 西山 和広 Ruby のコミッター github など: @znz 株式会社Ruby開発 www.ruby-dev.jp
1/10
ホスト Debian GNU/Linux 12 (bookworm) qemu-system* 1:7.2+dfsg-7+deb12u5 libvirt-daemon 9.0.0-4 u-boot-qemu
2023.01+dfsg-2 cloud-image-utils 0.33-1 2/10
ゲストイメージファイル https://cloud-images.ubuntu.com から ダウン ロード /${codename}/current/${codename}-server- cloudimg-${arch}.img でデイリービルド版 https://cloud-images.ubuntu.com/releases/ に
リリース版 基本デイリービルドでたまたま問題があるビルド だったらリリース版を選ぶぐらいでいいかも (実機用は https://cdimage.ubuntu.com/ releases/) 3/10
イメージをいい感じにする img=noble-server-cloudimg-riscv64.img wget https://cloud-images.ubuntu.com/noble/current/$img qemu-img resize "$img" +5G qcow2 形式
速度のため raw に変換するのもあり (qemu-img convert -f qcow2 -O raw "$orig" "$img") ギリギリのディスクサイズなのでリサイズ ちょっと試すなら +5G ぐらい もっと使うなら 16G とかに増やす (qemu-img resize "$img" 16G) 4/10
最低限の起動確認 qemu-system-riscv64 -nographic -M virt -m 1G \ -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf
\ -drive "if=virtio,format=qcow2,file=$img" -snapshot -machine (-M) は virt で良さそう -m は適当に増やす デフォルトの 128 だと起動しなかった -kernel は uboot で起動 -bios に opensbi の fw_jump.elf の指定は不要 -snapshot で書き込みは止めておいた 5/10
ログイン準備 mkdir config echo "instance-id: $(uuidgen || echo i-abcdefg)" >
config/meta-data vi config/user-data cloud-localds "seed.iso" config/user-data config/meta-data 起動できるが root もパスワードがなくてログ インできない cloud-init で設定するため ISO ファイル作成 -drive "if=virtio,format=raw,file=seed.iso" を追 加して起動 6/10
config/user-data 詳細は cloud-init のドキュメントを参照 例: https://cloudinit.readthedocs.io/en/latest/ reference/examples.html #cloud-config hostname: noble-riscv64
# user: ubuntu のパスワード設定 password: ubuntu chpasswd: { expire: False } ssh_pwauth: true # 各種設定 timezone: Asia/Tokyo locale: ja_JP.utf8 # 自分のssh鍵を設定 ssh_import_id: - gh:znz 7/10
起動 qemu-system-riscv64 -nographic -M virt -m 2G -smp 4 \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \ -drive "if=virtio,format=qcow2,file=$img" \ -drive "if=virtio,format=raw,file=seed.iso" \ -device "virtio-net-device,netdev=net0" \ -netdev "user,id=net0,hostfwd=tcp::2222-:22" \ -device virtio-rng-pci \ -snapshot メモリや CPU も増やした ネット接続や RNG デバイスも追加 「ssh -o "StrictHostKeyChecking no" -p 2222 ubuntu@localhost」でログイン可能 8/10
その他の設定 今日はここまで 後日、ブログ https://blog.n-z.jp/ に記事を書く 予定 qemu-guest-agent 対応 https://wiki.qemu.org/Documentation/9psetup でホ
ストとのファイル共有 自動起動のため libvirt 管理下に移行 9/10
まとめ cloud-images.ubuntu.com にある amd64, arm64, armhf, ppc64el, riscv64, s390x はどれ
も同じように使える(はず) 最低限の起動までは arch ごとに調査が必要 cloud-init でログインできる設定が必要 他の設定はできるだけシェルスクリプトや ansible などの provisioner を使う方が楽かも cloud-init は試行錯誤しにくい ansible などは知識の流用がしやすい 10/10 Powered by Rabbit 3.0.3