Raspberry Pi ファームウェアのアップデート方法

               公開日:2017/07/07
Raspberry Pi

Raspberry Pi

ファームウェアのアップデート方法は?

2017年7月、Raspberry Piのファームウェアアップデート(ダウングレード)方法を調べました。

Raspberry Pi

Raspberry Pi

ネットで調べるとファームウェアのアップデートは「rpi-update」で実施すると書いてあります。

sudo rpi-update

しかし、パッケージのアップデート方法を調べたときに、「apt-get dist-upgrade」でカーネル/ファームウェアを最新に更新するという記述を公式サイトでみつけました。

Raspberry Pi パッケージのアップデート方法

UPDATING THE KERNEL AND FIRMWARE

The kernel and firmware are installed as a Debian package, and so will also get updates when using the procedure above. These packages are updated infrequently and after extensive testing.

【要約】
カーネルとファームウェアはDebianパッケージとしてインストールされているので、上記の手順を使用してもアップデートされます。

それでは「rpi-update」とは、どんなものなのでしょうか?

rpi-updateについて

公式サイトの「DOCUMENTATION > LINUX > KERNEL > UPDATING」に説明があります。

Updating The Kernel

Updating The Kernel

 

UPDATING THE KERNEL

If you use the standard Raspbian update/upgrade process (found here), this will automatically update the kernel to the latest stable version. This is the recommended procedure. However, in certain circumstances, you may wish to update to the latest ‘bleeding edge’ or test kernel.

【要約】
標準のRaspbianの update/upgrade プロセスを使用すると、自動的にカーネルが最新の安定版に更新されます。これが推奨される手順です。
しかし、特定の状況では、最新の「開発最先端アルファ版」またはテストカーネルに更新することをお勧めします。

公式サイトによると「rpi-update」による最新のカーネル/ファームウェアのアップデートは推奨していません。

The rpi-update utility will download the latest (unstable, testing) kernel version and copy all required files onto your system. Note that the latest kernel from rpi-update is not guaranteed to work correctly! Make sure that it doesn’t conflict with your distribution packages. It doesn’t provide a way of automatically uninstalling the files.

【要約】
rpi-updateユーティリティは、最新の(不安定な、テスト中の)カーネルバージョンをダウンロードし、必要なすべてのファイルをシステムにコピーします。
rpi-updateの最新カーネルが正しく動作することは保証されていないことに注意してください!

「rpi-update」は、最新のカーネル/ファームウェアをダウンロードしますが、正しく動作する保証はないわけです。

使用する目的としては、現在のカーネル/ファームウェアのバグに遭遇してテストのために最新の修正を利用する場合などでしょう。

rpi-updateを実行する

最新のファームウェアは、GitHubのrpi-firmwareで管理しています。

現時点の最新カーネル/ファームウェアは、4.9.36です。これから、アップデートします。


現在のカーネル/ファームウェアのバージョンを確認します。

pi@pi3:~ $ uname -a
Linux pi3 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

pi@pi3:~ $ cat /boot/.firmware_revision 
b31b3744a922b2f89c7f0d23fe6a27822ac95451

「rpi-update」による最新のカーネル/ファームウェアのアップデートを実行します。

sudo rpi-update

*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom



*** Updating firmware
*** Updating kernel modules
*** depmod 4.9.36-v7+
*** depmod 4.9.36+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 400f6d196503e50b87025b888169f30214bc0f19
*** A reboot is needed to activate the new firmware

リブートします。

sudo reboot

更新後のカーネル/ファームウェアのバージョンを確認します。

pi@pi3:~ $ uname -a
Linux pi3 4.9.36-v7+ #1015 SMP Thu Jul 6 16:14:20 BST 2017 armv7l GNU/Linux

pi@pi3:~ $ cat /boot/.firmware_revision
400f6d196503e50b87025b888169f30214bc0f19

「4.9.35-v7+ #1014」から「4.9.36-v7+ #1015」にアップデートしました。

特定のバージョンにダウングレードする

特定のカーネル/ファームウェアにダウングレードするには、どうしたら良いか調べました。

 

To upgrade/downgrade to a specific firmware revision, specify its Git hash (from the https://github.com/Hexxeh/rpi-firmware repository) as follows:

sudo rpi-update fab7796df0cf29f9563b507a59ce5b17d93e0390

【要約】
特定のファームウェアリビジョンにアップグレード/ダウングレードするには、次のように、Gitハッシュを指定します。


特定のファームウェアリビジョンにダウングレードしてみます。

現在のカーネル/ファームウェアのバージョンを確認します。

pi@pi3:~ $ uname -a
Linux pi3 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

pi@pi3:~ $ cat /boot/.firmware_revision 
a8ee902ac25b98b77478c252af5580d631eb75a9

特定のファームウェアリビジョンを指定して、「rpi-update」します。

pi@pi3:~ $ sudo rpi-update  9e6a1a545ef33ac6cc3805845cb3ecac26514a41

*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom



*** Updating firmware
*** Updating kernel modules
*** depmod 4.9.31+
*** depmod 4.9.31-v7+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 9e6a1a545ef33ac6cc3805845cb3ecac26514a41
*** A reboot is needed to activate the new firmware

リブートします。

sudo reboot

更新後のカーネル/ファームウェアのバージョンを確認します。

pi@pi3:~ $ uname -a
Linux pi3 4.9.31-v7+ #1005 SMP Thu Jun 8 13:02:15 BST 2017 armv7l GNU/Linux

pi@pi3:~ $ cat /boot/.firmware_revision
9e6a1a545ef33ac6cc3805845cb3ecac26514a41

カーネルバージョン 4.9.31-v7+ #1005 にダウングレードしました。

まとめ

「rpi-update」は、最新のカーネル/ファームウェアにアップデートしますが安定版ではありません。

パッケージのアップデートで安定版のカーネル/ファームウェアにアップデートできますので、「rpi-update」は使う必要はありません。

通常は、パッケージのアップデートで十分です。

sudo apt-get update
sudo apt-get dist-upgrade

 

 

このエントリーをはてなブックマークに追加

Raspberry Pi ファームウェアのアップデート方法」への1件のフィードバック

  1. ピンバック: Raspberry Pi Zeroのセットアップ – jumbleat

コメントは受け付けていません。