Fwupd
fwupd 是一個進行設備固件更新的簡單守護程序,雖然是為桌面計算機設計,但是同樣也支持手機和服務器。
安裝[編輯 | 編輯原始碼]
如果您將其用於 UEFI 固件升級,請參閱 #UEFI 升級設置。
圖形化前端[編輯 | 編輯原始碼]
某些桌面環境前端解決方案具有內置的 fwupd 支持:
- GNOME Software — 將定期檢查更新,並在 GNOME 的後台自動下載固件。下載固件後,將在 Gnome Software 中顯示一個彈出窗口以執行更新。
- KDE Discover — 與 Plasma 一起使用的軟件中心。隨着 KDE Plasma 5.14 的發布,KDE Discover中已實現了新的 fwupd 後端以進行固件更新。這些固件更新與其他系統更新一起顯示。
- GNOME Firmware — 在 fwupd 支持的設備上升級,降級和重新安裝固件的應用程序。它可以解鎖鎖定的 fwupd 設備,驗證支持的設備上的固件並顯示 fwupd 設備的所有發行。
使用[編輯 | 編輯原始碼]
要顯示 fwupd 檢測到的所有設備:
$ fwupdmgr get-devices
要從 Linux Vendor firmware Service (LVFS) 下載最新的元數據:
$ fwupdmgr refresh
要列出系統上任何設備可用的更新:
$ fwupdmgr get-updates
要安裝更新:
$ fwupdmgr update
- 可以實時應用的更新將立即完成。
- 在啟動時運行的更新將為下一次重新啟動做好準備。
- 可能需要使用 root 用戶執行特定設備的更新。
UEFI 升級設置[編輯 | 編輯原始碼]
- 使用 UEFI 模式啟動系統,efibootmgr 無法在舊版啟動模式下工作。
- 驗證 您的 EFI 變量是否可以獲取。
- 正確掛載 EFI 系統分區 (ESP),
esp
用於表示此部分中的掛載點。 - 請安裝可選依賴 udisks2包,這個軟件包提供了 UEFI 升級支持。
準備 ESP 目錄[編輯 | 編輯原始碼]
fwupd 會將所有必需的文件複製到 esp
上,但是要使其正常工作,"esp" 上必須存在基本的文件夾布局。
這會在 esp
目錄創建 EFI
目錄 。
mkdir esp/EFI/
創建後,必須重新啟動 fwupd.service
服務。
您現在可以 $ fwupdmgr refresh
和 $ fwupdmgr update
。它將要求重新啟動,現在應該自動重新啟動到固件更新程序。
安全啟動[編輯 | 編輯原始碼]
在安全啟動開啟的系統下,fwupd 使用 shim 來引導 fwupd EFI 文件。使用前請確保正確安裝 shim。
用自己的密鑰[編輯 | 編輯原始碼]
或者,您必須手動簽名用於執行升級的 UEFI 可執行文件,該文件位於 /usr/lib/fwupd/efi/fwupdx64.efi
。
已簽名的 UEFI 可執行文件應放在 /usr/lib/fwupd/efi/fwupdx64.efi.signed
.
使用 sbsigntools包,可以通過運行以下命令來實現:
# sbsign --key keyfile --cert certfile /usr/lib/fwupd/efi/fwupdx64.efi
為了使安裝或者升級時自動簽名,使用 Pacman 掛鈎:
/etc/pacman.d/hooks/sign-fwupd-secureboot.hook
[Trigger] Operation = Install Operation = Upgrade Type = Path Target = usr/lib/fwupd/efi/fwupdx64.efi [Action] When = PostTransaction Exec = /usr/bin/sbsign --key keyfile --cert certfile /usr/lib/fwupd/efi/fwupdx64.efi Depends = sbsigntools
確保用密鑰的相應路徑替換 <keyfile>
和 <certfile>
。
除了 Pacman 掛鈎,您也可以創建從 /usr/lib/fwupd/efi/fwupdx64.efi
到 /usr/lib/fwupd/efi/fwupdx64.efi.signed
的符號鏈接,並將文件添加到 /etc/sbupdate.conf
中的 EXTRA_SIGN
列表中。
最後,您必須將 /etc/fwupd/uefi_capsule.conf
中包含 DisableShimForSecureBoot
的行更改為 DisableShimForSecureBoot=true
並重新啟動 fwupd.service
。
查閱此 GitHub issue,以獲取更多討論此問題的信息。
故障排除[編輯 | 編輯原始碼]
一直卡在重啟[編輯 | 編輯原始碼]
fwupdmgr update
reports no error, but the reboot it prompts stuck and holding the power button has no response. Try switching off the power, or press the reset button (on a laptop, it might be a hole on the back) to force-reboot.
沒有錯誤,但重啟後沒有升級[編輯 | 編輯原始碼]
狀況:fwupdmgr update
未報告任何錯誤並提示重新啟動(例如,在 BIOS 更新中)。 但是,系統將正常重啟,並且不會進行固件更新。
可能的原因:在 BIOS 設置中,必須允許更改引導順序。
Possible other solution if there are multiple updates pending: Try updating packages one at a time. Use the following to select packages:
$ fwupdmgr update update_ID
(Where update_ID
is something like f95c9218acd12697af946874bfe4239587209232
.)
read-only filesystem error[編輯 | 編輯原始碼]
At least fwupdmgr
1.5.2 deduces the wrong mount point if bind is used to mount esp
to /boot
[1]. Consequently it fails to write the UEFI update file to /boot/EFI/arch/fw
(fwupdmgr
while it should be written to esp/EFI/arch/fw
.) This results in a (misleading) "file system is read-only" error message. In case the update was performed by Discover
(or any other fwupd-capable Update GUI), no error or misleading errors may be shown.
As a workaround, run umount /boot
first if it was bind-mounted to esp/EFI/arch
before, then run fwupdmgr update
to write the UEFI update file to esp/EFI/arch/fw
, mount /boot
and reboot the system to perform the UEFI update.
UEFI ESP partition not detected or configured[編輯 | 編輯原始碼]
如果按上面 UEFI 更新的要求執行了操作,還是無法識別 ESP 分區,可以手動指定掛載點:
/etc/fwupd/uefi_capsule.conf
[uefi_capsule] OverrideESPMountPoint=/efi # Change according to your setup
Also see the relevant article in the fwupd wiki.
MSR plugin is failing to load[編輯 | 編輯原始碼]
The MSR plugin allows querying the state of DCI, a debugging interface available for Intel CPUs that should be disabled on production machines according to fwupd's documentation.
This plugin needs the msr
kernel module loaded. msr
is a built-in kernel module in all the official Arch Linux kernel packages, but unofficial kernel packages might have it as a loadable kernel module. In the latter case, we need to explicitly load the module at boot.
Failed to load daemon: failed to load engine: No ESP with path[編輯 | 編輯原始碼]
When starts fwupd, it checks the esp location as EspLocation
from /etc/fwupd/daemon.conf
. Modify it to your corresponding setup if encounter this error.