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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuhiro NISHIYAMA
April 27, 2024
Programming
150
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
46
Headscale + Tailscale に移行中
znz
0
87
Ruby on Rails と私
znz
0
88
riscv64.rubyci.org internal
znz
0
66
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
120
devise-two-factorを4.xから5.xに上げた話
znz
0
450
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
120
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
160
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
150
Other Decks in Programming
See All in Programming
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
450
Introducing Stack Pull Request in GitHub
kkamegawa
0
120
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
510
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
110
Cloudflare is Agents
chimame
0
190
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
410
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
180
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
120
初めての模倣学習とVLA
natsutan
0
350
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
750
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
560
AIの中の人になってみる
htkym
0
140
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
400
Darren the Foodie - Storyboard
khoart
PRO
3
3.8k
Believing is Seeing
oripsolob
1
200
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
500
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
510
The Spectacular Lies of Maps
axbom
PRO
1
950
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
500
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
630
How to train your dragon (web standard)
notwaldorf
97
6.8k
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