Linux ファームウェア
Linux ファームウェアは、特定のハードウェアデバイスの一部または全体を機能させるために必要なファームウェアバイナリブロブを含み、Linux カーネルとまとめて頒布されているパッケージです。ハードウェア製造元の中には、ファームウェア自身をビルドするために必要なソースコードをリリースしていないところもあるため、これらのバイナリブロブはふつうはプロプライエタリです。
AMD と NVIDIA による現代的なグラフィックカードはほぼ確実に、ハードウェアを正しく動作させるためにバイナリブロブがロードされていることを要求します。
Broxton (Skylake ベースのマイクロアーキテクチャ) 以降、Intel CPU は追加の低電力アイドル状態 (DMC)、多様な並列グラフィックスエンジン上でのワークロードスケジューリング (GuC)、そして一部のメディア機能の負荷を CPU から GPU に退避させる (HuC) ために、バイナリブロブを必要とします。[1]
さらに、現代的な Intel Wi-Fi チップセットはほとんど必ずブロブを必要とします。[2]
インストール
セキュリティ上の理由から、実行中のカーネルにファームウェアをホットロードするのは避けられています。systemd のような現代的な init システムでは、ユーザ空間からファームウェアをロードすることはとてもおすすめできません。
カーネル
Linux カーネル内に特定のデバイスのためのファームウェアサポートを組み込む場合は、いくつか考慮すべき重要なオプションがあります:
GPL の条項下では、ファームウェアファイルをバイナリカーネルイメージに含めることはできません。そのようなイメージが頒布された場合、GPL 違反につながるおそれがあります。sys-kernel/linux-firmware に由来するファームウェアファイルを含むカーネルを頒布する前に、法律家に相談するのが賢明です。
v4.18 より前のカーネル
バージョン 4.18 より前にリリースされたカーネルでは:
- CONFIG_FIRMWARE_IN_KERNEL (非推奨)
- このオプションはバージョン v4.16 現在削除されています。[3]以前は EXTRA_FIRMWARE で指定されたファームウェアブロブをカーネルに組み込むには、
request_firmware()
関数がユーザ空間に抜けて呼び出しを行う必要なしにブロブを見つけるために、このオプションを有効化する必要がありました。古いカーネルではこれを有効化する必要があります。
Device Drivers ---> Generic Driver Options ---> -*- Userspace firmware loading support [*] Include in-kernel firmware blobs in kernel binary (/lib/firmware) Firmware blobs root directory
v4.18 以降のカーネル
4.18 以降のカーネルでは:
- Firmware loading facility ( CONFIG_FW_LOADER )
- This option is provided for the case where none of the in-tree modules require userspace firmware loading support, but a module built out-of-tree does.
- Build named firmware blobs into the kernel binary ( CONFIG_EXTRA_FIRMWARE )
- This option is a string and takes the (space-separated) names of firmware files to be built into the kernel. These files will then be accessible to the kernel at runtime.
Device Drivers ---> Generic Driver Options ---> Firmware loader ---> -*- Firmware loading facility () Build named firmware blobs into the kernel binary (/lib/firmware) Firmware blobs root directory
USE フラグ
USE flags for sys-kernel/linux-firmware Linux firmware files
compress-xz
|
Compress firmware using xz (app-arch/xz-utils) before installation |
compress-zstd
|
Compress firmware using zstd (app-arch/zstd) before installation |
initramfs
|
Create and install initramfs for early microcode loading in /boot (only AMD for now) |
redistributable
|
Install also non-free (but redistributable) firmware files |
savedconfig
|
Allows individual selection of firmware files |
unknown-license
|
Install firmware files whose license is unknown |
emerge
root #
emerge --ask sys-kernel/linux-firmware
選択可能: savedconfig
After emerging sys-kernel/linux-firmware, the configuration file is made into /etc/portage/savedconfig/sys-kernel/linux-firmware-ddmmyyyy. This file can be edited and the unwanted lines be commented out or deleted. Edit and save the file and re-emerge sys-kernel/linux-firmware with the savedconfig
USE flag:
root #
echo sys-kernel/linux-firmware savedconfig >> /etc/portage/package.use/kernel
root #
emerge --ask sys-kernel/linux-firmware
選択可能: 圧縮
Firmware to be loaded into the kernel can be compressed in order to achieve greater space efficiency and faster read speeds (at the expense of processing time). See the CONFIG_FW_LOADER_COMPRESS kernel symbol for additional information.
xz compression is supported via the CONFIG_FW_LOADER_COMPRESS_XZ symbol. Note that only none or crc32 integrity check types (by passing -C crc32
option to the xz command) are supported.
バージョン 5.19 現在、CONFIG_FW_LOADER_COMPRESS_ZSTD シンボルによって zstd 圧縮がサポートされています。[4]
トラブルシューティング
ロードされているファームウェアを検索する
どのファームウェアがロードされているか判断するには dmesg を利用できます:
user $
dmesg | grep -i firmware
削除
unmerge
root #
emerge --ask --depclean --verbose sys-kernel/linux-firmware
関連項目
- Fwupd — a daemon that provides a safe, reliable way of applying firmware updates on Linux.
- Kernel — オペレーティングシステムの中核
- Iwlwifi — Intel の現行の無線チップのための無線ドライバです。
- Microcode — describes various ways to update a CPU's microcode in Gentoo.
- AMDGPU — the next generation family of open source graphics drivers using the new Display Core (DC) framework for Vega GPUs and Raven Ridge APUs. It is however also capable of handling newer AMD/ATI Radeon graphics cards based on GCN1.0+, namely the Southern Islands, Sea Islands, Volcanic Islands, and Arctic Islands chipsets.
- Intel — the open source graphics driver for Intel GMA on-board graphics cards and Intel Arc dedicated graphics cards, starting with the Intel 810.