RISC-VボードNezhaに添付されてるDebianの情報

これはDebianベースのベンダー提供のイメージに関する古い話。 Debian 13 (Trixie) 以降公式のDebian でサポートされるようになったので、 単にNezhaでDebian を使いたいだけの場合公式Debianを使うに記載した情報だけで十分。

私が買ったNezhaには、添付されていたmicroSDカードにDebian が書きこまれていた。 これはベンダーのkernel が使われていてちょっとくせがあったのでそのメモ。

起動メッセージを見ると、OpenSBI, u-boot, Linux の順に起動している。 X11 が起動すると、HDMIポートから画面出力が始まり、ここからログインすると通常の「Linuxデスクトップ」が利用できる。 Debian Unstable 相当の環境だ。
RVBoards-Nezha screenshot of Debian desktop

MACアドレスが毎回変わる

Ethernet のMAC アドレスが起動のたびに変わってしまう。 Debian 環境なので、/etc/network/interfaces で以下のように適当なMAC に固定してしまうと良い。

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
        hwaddress ether 08:00:26:fe:5d:66

添付されてるDebianのイメージでDebianのaptミラーが接続できない

2021年10月末ごろから、PerfXLabの運営するNezha用のDebian aptミラーが正常にアクセスできず、Releaseファイルが404を返すようになっている。 この結果、apt-get update を実行した際に以下のようなエラーになる:

Ign:1 http://mirrors.perfxlab.cn/debian-ports sid InRelease
Ign:2 http://mirrors.perfxlab.cn/debian-ports unreleased InRelease
Err:3 http://mirrors.perfxlab.cn/debian-ports sid Release
  404  Not Found [IP: 47.99.187.160 80]
Err:4 http://mirrors.perfxlab.cn/debian-ports unreleased Release
  404  Not Found [IP: 47.99.187.160 80]
Reading package lists... Done
E: The repository 'http://mirrors.perfxlab.cn/debian-ports sid Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.perfxlab.cn/debian-ports unreleased Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

この状況だとかなり使いにくいので、2021年11月現在のおすすめは、PerfXLabの提供するDebianではなくてSipeed の提供するD1用のDebian [aw-ol.com]を利用することだ。 Sipeed版DebianのイメージでMicroSDカードを作るとき、.imgのファイルはまっすぐなイメージファイルではないためddで書き込んでも起動できなくて、Allwinnerの提供するPhoenixCard (動作確認したバージョンは4.2.7)を用いて「Start Up」の設定で書き込む必要があるので注意が必要。

Sipeed版のほうは、aptのsource設定はhttp://ftp.ports.debian.org/debian-ports/を指しており、サーバの利用者数はPerfXLabよりも多そうな感じ。 使っているレポジトリがdebian-portsなので、毎年aptのGPGキーが変わって、年を越すと

# apt -y update
Get:1 http://ftp.ports.debian.org/debian-ports sid InRelease [65.1 kB]
Err:1 http://ftp.ports.debian.org/debian-ports sid InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E
852514F5DF312F6
Fetched 65.1 kB in 3s (25.1 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.ports.debian.org/debian-ports sid InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E852514F5DF312F6
W: Failed to fetch http://ftp.ports.debian.org/debian-ports/dists/sid/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E852514F5DF312F6
W: Some index files failed to download. They have been ignored, or old ones used instead.

というエラーが出る。curl https://www.ports.debian.org/archive_2022.key | apt-key add -のように新しい年のキーをインポートすれば解決できる。