Site Tools


Action unknown: plugin_move
it:rpi:raspbian

Raspbian のRpi4へのインストール

HDMIのポートを使う場合の注意:二つあるHDMIポートのうち,片方だけしか表示されない場合があるので注意。

buster のインストール

buster lite (2020-02-13-raspbian-buster-lite.img)をwin32diskimager などでSDカードに書き込んで,電源を入れるだけで,起動する

シリアルコンソールの設定

FAT32パーティションの config.txt の最後([all]の後)に以下を追加する

  enable_uart=1

その後,リブートする。

RPi4では,シリアルケーブルをつないだ状態では起動しないので,起動後後(緑LEDの点滅で予想して)にシリアルをつなぐ必要がある。

起動したら,シリアルコンソールでpi/raspberry でログインできる。

wifiの設定

/etc/wpa_supplicant/wpa_supplicant.conf に以下を記述する

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP

network={
        ssid="aterm-277b8a-g"
        psk="パスワード"
}

これを記述して,から以下を実行する。

rfkill unblock wifi
ifconfig wlan0 up
reboot

タイムゾーンの設定

sudo raspi-config

で設定する。

パーティションの拡張

parted /dev/sda

(parted) unit s
(parted) print free
Model: Generic USB Disk (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start      End         Size        Type     File system  Flags
        32s        8191s       8160s                Free Space
 1      8192s      532479s     524288s     primary  fat32        lba
 2      532480s    60751871s   60219392s   primary  ext4
        60751872s  488397167s  427645296s           Free Space

(parted) resizepart 2 488397167s
(parted) print free
Model: Generic USB Disk (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start    End         Size        Type     File system  Flags
        32s      8191s       8160s                Free Space
 1      8192s    532479s     524288s     primary  fat32        lba
 2      532480s  488397167s  487864688s  primary  ext4

(parted) q


fsck.ext4 -f /dev/sda
resize2fs /dev/sda2

IPアドレスの固定

/etc/dhcpcd.conf に以下を記述する

interface eth0
static ip_address=192.168.1.31/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.1.1
static domain_name_servers=192.168.1 8.8.8.8 fd51:42f8:caae:d92e::1

ユーザの追加

adduser fu

sudoできるようにするには

/etc/sudoers.d/010_pi-nopasswd に倣って,ファイルを作成すればよい

it/rpi/raspbian.txt · Last modified: by fu