2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi 3 B (3 B+ではない) で64bit版をUSBブート、初期設定、dockerを使えるまで

Last updated at Posted at 2021-02-12

RaspberryPi 3 Model B+ではUSBブートが出荷時から有効になっているらしいが、
残念ながら手元のはB+ではない。
調べてみるとUSBブートにできるようなので試してみた。

OSのダウンロード

最近のRaspberryPiは64bit版も準備されているので、そちらを使うこととした。

64bit版ベータをダウンロード(上がGUI有り、下がCUIのみ)

https://downloads.raspberrypi.org/raspios_arm64/images/
https://downloads.raspberrypi.org/raspios_lite_arm64/

SSHを有効にする

  • sshファイルがないとsshが有効になっていないので注意。

boot のボリュームに sshまたはssh.txtを作成する。

ssh.png

MicroSDで普通に起動

モニターを接続せずにRaspberryPiを探すには以下

ping -4 raspberrypi
ssh raspberrypi
  • user : pass = pi : raspberry

usbブート

MicroSDでbootし、以下確認。

USBブート無効
$ vcgencmd otp_dump | grep ^17:
17:1020000a

上記の場合、USBブートが無効になっている。
config.txtに設定を追記しUSBブートを有効にする。

設定追記

/boot/config.txt
program_usb_boot_mode=1
  • reboot
USBブート有効
$ vcgencmd otp_dump | grep ^17:
17:3020000a

USBメモリからブート

RaspberryPiの電源をOFFにする。
MicroSDを抜き、
OSが入ったUSBメモリを差し込み電源を入れる。1分くらい待つとbootするのがわかる。

raspi-config

sudo raspi-config

メモリの空きを確保 (割り当て 913MB -> 962MB に増える)

  • 7 Advanced Options -> A3 Memory Split -> 16 (初期値は64。)

日本語設定

  • 4 Localisation Options
    • -> I1 Change Locale -> ja_JP.UTF-8 UTF-8
    • -> I2 Change Time Zone -> Asia/Tokyo
    • -> I4 Change WLAN Country -> JP Japan

ファームウェアのアップデート

sudo rpi-update

update.PNG

TeamViewer

apt install -y libxtst6:armhf

docker

# インストール
curl -sSL https://get.docker.com | sh

# グループに追加
sudo usermod -aG docker pi

sudo apt install -y docker-compose

Docker Hub に push

docker loginで以下エラーになった場合は、gnupg2とpassを入れる。

Cannot autolaunch D-Bus without X11 $DISPLAY

apt install -y gnupg2 pass
docker push イメージ名

メモ: x86でarm用ビルド

  • 32bit : armv7l
  • 64bit : aarch64
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?