trixie(Debian13)からcloud-initが導入され、Raspberry Pi Imagerが吐き出す設定ファイルを、trixieに反映する仕組みが導入されました。
その仕組みを利用すれば、起動ディスクを作成した後、Windowsパソコンから直接、ネットワークの設定、停止させたいハードなどの設定が行えるようになりました。理由は、ドライブ直下のファイルは、/boot/firmwareの配下のファイルだからです。
ここでは、3.Raspberry Piの起動ディスク作成が終わった後、4.Raspberry Piの電源を入れてSSHで接続ならびに5.起動して最初にやらないといけない事をまとめて、実行する手順を説明します。
簡単にセットアップするための概要
trixie(Debian13)の2025-12-04版以降を使用する場合、下記の手順でインストールの相当量の作業を簡単に済ませることが出来ます。理由は、trixie(Debian13)がcloud-initを採用して、Raspberry Pi Imagerから多彩な設定が出来るような道筋を付けたことです。
- Raspberry Pi Imager2.0.6以上で、起動ディスクを作成
- Windowsパソコンで、起動ディスクの設定ファイルを直接編集
- 起動ディスクをRaspberry Piに装着して起動
まだ、Raspberry Pi Imager2.0.6で設定できることは少ないのですが、今後固定IPの設定など機能拡張が進んでいくと考えられます。
Raspberry Pi Imager2.0.6以上で、起動ディスクを作成
起動ディスクの作成は、このブログで説明の3.Raspberry Piの起動ディスク作成の手順で作成してください。
パソコンで、起動ディスクの設定ファイルを直接編集
Raspbery Pi Imagerで作成した起動ディスクを、Windowsパソコンに接続するとWindowsのドライブとして認識されます。
ドライブの配下には、下記のファイルが存在します。Linuxから見ると/boot/firmware配下の内容と同じです。つまり、Windowsパソコンのエディタを使って、Raspberry Piの設定ができるのです。
C:\temp>dir /w e:\
ドライブ E のボリューム ラベルは bootfs です
ボリューム シリアル番号は EACA-13DA です
e:\ のディレクトリ
[overlays]
bcm2710-rpi-2-b.dtb
LICENCE.broadcom
issue.txt
bcm2710-rpi-3-b-plus.dtb
bcm2710-rpi-3-b.dtb
bcm2710-rpi-cm0.dtb
bcm2710-rpi-cm3.dtb
bcm2710-rpi-zero-2-w.dtb
bcm2710-rpi-zero-2.dtb
bcm2711-rpi-4-b.dtb
bcm2711-rpi-400.dtb
bcm2711-rpi-cm4-io.dtb
bcm2711-rpi-cm4.dtb
bcm2711-rpi-cm4s.dtb
bcm2712-d-rpi-5-b.dtb
bcm2712-rpi-5-b.dtb
bcm2712-rpi-500.dtb
bcm2712-rpi-cm5-cm4io.dtb
bcm2712-rpi-cm5-cm5io.dtb
bcm2712-rpi-cm5l-cm4io.dtb
bcm2712-rpi-cm5l-cm5io.dtb
bcm2712d0-rpi-5-b.dtb
bootcode.bin
cmdline.txt
config.txt
fixup.dat
fixup4.dat
fixup4cd.dat
fixup4db.dat
fixup4x.dat
fixup_cd.dat
fixup_db.dat
fixup_x.dat
initramfs8
initramfs_2712
kernel8.img
kernel_2712.img
meta-data
network-config
start.elf
start4.elf
start4cd.elf
start4db.elf
start4x.elf
start_cd.elf
start_db.elf
start_x.elf
user-data
48 個のファイル 75,128,004 バイト
1 個のディレクトリ 458,063,872 バイトの空き領域
アカウントなどの情報はuser-dataに設定されていますが、そのまま使用します。内容は、Raspberry Pi Imagerで設定したアカウント情報やキーボード情報等です。
ネットワークの設定は、network-configに設定されていますが、Raspberry Pi Imager2.0.6時点では、あまり設定できないようなので、直接編集します。設定内容は
- IPv4の固定IPアドレスのみ有効とする。
- IPv6は無効とする。
- Wi-Fiは無効とする。
network:
version: 2
ethernets:
eth0:
dhcp4: false
dhcp6: false
ipv6: false
addresses:
- 192.168.100.100/24
gateway4: 192.168.100.1
nameservers:
addresses: [8.8.8.8, 192.168.100.1]
optional: true
wifis:
wlan0:
dhcp4: false
dhcp6: false
ipv6: false
access-points: {}
optional: true
IPv6は使用しないので、カーネルパラメータを指定するcmdline.txtで、ipv6.disable=1をrootwaitの手前に指定します。必ず一行が長くなっても、改行しないよう一行で編集する必要があります。
console=serial0,115200 console=tty1 root=PARTUUID=ffc763c1-02 rootfstype=ext4 fsck.repair=yes ipv6.disable=1 rootwait resize cfg80211.ieee80211_regdom=JP
config.txtには、ハード的に使用するものしないものを指定します。ファイルの赤字の部分が編集・追加した部分です。
- オーディオ無効
- カメラ無効
- Wi-Fiを無効化
- Bluetoothの無効化
- PCIe Gen3.0を設定(Raspberry Pi5専用)
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Enable audio (loads snd_bcm2835)
# dtparam=audio=on
# Additional overlays and parameters are documented
# /boot/firmware/overlays/README
# Automatically load overlays for detected cameras
# camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
# Run as fast as firmware / board allows
arm_boost=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[cm5]
dtoverlay=dwc2,dr_mode=host
[all]
# Raspberry Pi5専用の設定 PCIe Gen3.0
dtparam=pciex1
dtparam=pciex1_gen=3
# Bluetoothの無効化
dtoverlay=disable-bt
# Wi-Fiの無効化
dtoverlay=disable-wifi
この状態で、起動ディスクをRaspberry Piに接続して起動します。
起動ディスクをRaspberry Piに装着して起動
NetworkManageは、network-configを元に作成されたファイルを読み込みネットワーク環境を生成するので、先ほど設定した固定IPでRaspberry Piは起動します。
つまり起動直後から、SSH(Teraterm)で設定の固定IPアドレスで接続が可能となります。
その後は、5.起動して最初にやらないといけない事で説明しているvimのインストールおよびrsyslogのインストールを行います。
不要なサービスの停止は、下記のコマンドを投入します。一行なので端までコピーして実行してください。
$ sudo systemctl stop avahi-daemon.socket && sudo systemctl stop avahi-daemon.service && sudo systemctl stop bluetooth.service && sudo systemctl stop cloud-config.service && sudo systemctl stop cloud-final.service && sudo systemctl stop cloud-init-local.service && sudo systemctl stop cloud-init-main.service && sudo systemctl stop cloud-init-network.service && sudo systemctl stop ModemManager.service && sudo systemctl stop wpa_supplicant.service
不要なサービスの非活性は、下記のコマンドを投入します。一行なので端までコピーして実行してください。
$ sudo systemctl disable avahi-daemon.socket && sudo systemctl disable avahi-daemon.service && sudo systemctl disable bluetooth.service && sudo systemctl disable cloud-config.service && sudo systemctl disable cloud-final.service && sudo systemctl disable cloud-init-local.service && sudo systemctl disable cloud-init-main.service && sudo systemctl disable cloud-init-network.service && sudo systemctl disable ModemManager.service && sudo systemctl disable wpa_supplicant.service
しかし、これだけでは、cloud-initの初期フェーズがとまらずnetplanが動き続けます。そこで下記のコマンド完全に停止します。
sudo touch /etc/cloud/cloud-init.disabled
併せて、初期起動で作成された、下記ファイルを削除します。
$ sudo rm /etc/netplan/*
$ sudo rm /run/NetworkManager/system-connections/*
更に、NetworkManagerのコネクションIDをeth0に変えて、見やすくしておきます。
$ sudo nmcli connection modify 'netplan-eth0' connection.id eth0
これで、一連の設定は終わりです。この後Raspbery Piを再起動してください。
$ sudo reboot
vimをインストール
$ sudo apt-get -y install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libgpm2 libsodium23 vim-runtime
Suggested packages:
gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
libgpm2 libsodium23 vim vim-runtime
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,789 kB of archives.
After this operation, 43.9 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian trixie/main arm64 libgpm2 arm64 1.20.7-11+b2 [14.7 kB]
Get:2 http://deb.debian.org/debian trixie/main arm64 libsodium23 arm64 1.0.18-1+b2 [121 kB]
Get:3 http://deb.debian.org/debian trixie/main arm64 vim-runtime all 2:9.1.1230-2 [7,127 kB]
Get:4 http://deb.debian.org/debian trixie/main arm64 vim arm64 2:9.1.1230-2 [1,527 kB]
Fetched 8,789 kB in 1s (10.5 MB/s)
Selecting previously unselected package libgpm2:arm64.
(Reading database ... 66180 files and directories currently installed.)
Preparing to unpack .../libgpm2_1.20.7-11+b2_arm64.deb ...
Unpacking libgpm2:arm64 (1.20.7-11+b2) ...
Selecting previously unselected package libsodium23:arm64.
Preparing to unpack .../libsodium23_1.0.18-1+b2_arm64.deb ...
Unpacking libsodium23:arm64 (1.0.18-1+b2) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a9.1.1230-2_all.deb ...
Adding 'diversion of /usr/share/vim/vim91/doc/help.txt to /usr/share/vim/vim91/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim91/doc/tags to /usr/share/vim/vim91/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:9.1.1230-2) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a9.1.1230-2_arm64.deb ...
Unpacking vim (2:9.1.1230-2) ...
Setting up libsodium23:arm64 (1.0.18-1+b2) ...
Setting up libgpm2:arm64 (1.20.7-11+b2) ...
Setting up vim-runtime (2:9.1.1230-2) ...
Setting up vim (2:9.1.1230-2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
Processing triggers for man-db (2.13.1-1) ...
Processing triggers for libc-bin (2.41-12+rpt1) ...
vimが使いやすいように設定
$ vi ~/.vimrc
syntax on
set incsearch
colorscheme elflord
set mouse=
ファイルroot向けにコピー
$ sudo cp .vi* /root/
rsyslogをインストール
とこれで基本的な設定が終了しました。
この後は、6.Raspberry Pi OSの基本設定に進んでください。

