如何使用 fwupd 在 Ubuntu 上更新固件

轉發 是一個守護進程,用於幫助管理 Linux 上的固件安裝。 Fwupd 默認配置為從 Linux Vendor Firmware Service (LVFS) 下載固件。 LVFS 是一個安全的網站,允許硬件供應商上傳他們的固件更新。

Fwupd 旨在使 Linux 系統上的固件更新自動化、安全、可靠。 它主要用於更新 UEFI 固件。 有許多公司已經支持本地固件更新,例如戴爾、聯想、惠普、英特爾和 System76。

在本教程中,我們將學習如何 更新固件Ubuntu 使用 fwupd。

在 Ubuntu 上安裝 fwupd

默認情況下,Fwupd 在較新版本的 Ubuntu 上可用。 如果未安裝該工具,請運行以下命令從 Ubuntu 存儲庫進行安裝。

$ sudo apt install fwupd

要在命令行上更新需要最新 fwupd 版本的特定設備,請使用安裝 fwupd 折斷 或使用 平板包裝.

顯示支持的設備

要檢測和顯示具有 fwupd 支持的固件的設備,請使用以下命令。

$ fwupdmgr get-devices

輸出:

20FMS1W300

├─System Firmware:
│ Device ID: 218dfc72dd94339f3c3fe47b0df642273d049170
│ Current version: 0.1.41
│ Minimum Version: 0.1.22
│ Vendor: LENOVO (DMI:LENOVO)
│ GUIDs: c9a0acef-aa63-4b85-a52d-a9384163c0e8
│ 230c8b18-8d9b-53ec-838b-6cfc0383493a
│ 717544ba-7153-5a85-be27-9c9ea9b078d0
│ Device Flags: • Internal device
│ • Updatable
│ • System requires external power source
│ • Supported on remote server
│ • Needs a reboot after installation
│ • Cryptographic hash verification is available
│ • Device is usable for the duration of the update

├─TS240GSSD220S:
│ Device ID: e421b2fc248391f6fe3e55ddbb3c9043be068bd0
│ Summary: ATA Drive
│ Current version: R0123A0
│ Vendor: Transcend (ATA:0x8564)
│ GUIDs: 6771f965-9e0a-5a09-8271-ef0f66ac2f37
│ bbff7a8b-2ac7-5dd8-a13f-d0be97e02695
│ 3a74d7ba-b063-5a4f-b9e4-35229efc7b5b
│ Device Flags: • Internal device
│ • Updatable
│ • System requires external power source
│ • Needs a reboot after installation
│ • Device is usable for the duration of the update

├─UEFI Device Firmware:
│ Device ID: 272f84ea6e0e8c9a566ee486fa5299feb1a3a3b6
│ Current version: 2953577449
│ Minimum Version: 1
│ Vendor: DMI:LENOVO
│ GUIDs: c5ef09d4-1f20-41fc-a197-ed88ba3c9bd7
│ 5546bb0d-20e1-5e53-9c0b-8b6da1f3981c
│ Device Flags: • Internal device
│ • Updatable
│ • System requires external power source
│ • Needs a reboot after installation
│ • Device is usable for the duration of the update

└─UEFI Device Firmware:
Device ID: 1e27bf0e569658d727f2d126752b270ed048ea45
Current version: 65544
Minimum Version: 1
Vendor: DMI:LENOVO
GUIDs: dad450ea-85da-4121-ae37-ce857cfa2b8e
dda61f4f-5fb5-522a-8020-fb78ba4a7976
Device Flags: • Internal device
• Updatable
• System requires external power source
• Needs a reboot after installation
• Device is usable for the duration of the update

在這 example,我們可以看到我有四個fwupd支持的設備。 你也可以檢查 LVFS 支持的設備 以及已向公眾提供的所有更新。

從 LVFS 下載最新的元數據

refresh 選項將下載最新的元數據。 要從 LVFS 下載最新的元數據,我們將鍵入以下命令:

$ fwupdmgr refresh

輸出:

Firmware metadata last refresh: 1 hour ago. Use --force to refresh again.

我們可以看到我們的系統上有最近的元數據。

檢查可用的固件更新

要顯示系統上任何設備的可用更新,請使用 get-updates 選項。

$ fwupdmgr get-updates

就我而言,我收到通知,我的設備沒有可用的更新:

Devices with no available firmware updates:
• TS240GSSD220S
• UEFI Device Firmware
• UEFI Device Firmware
Devices with the latest available firmware version:
• System Firmware
No updates available for remaining devices

但是,在另一個 Linux 系統上似乎有可用的固件更新:

Devices with no available firmware updates:
 • SC300B HFS256G39MND-3510B
 • System Firmware
 • UEFI dbx
20F90044GE

└─Intel Management Engine:
  │   Device ID:          25127f5d4d5dfd6e903cda1a61a67cb092e4bb0f
  │   Current version:    184.79.3722
  │   Minimum Version:    184.79.3722
  │   Vendor:             DMI:LENOVO
  │   GUIDs:              63451986-0c42-42db-9a18-342a8455ac68
  │                       0e559cf4-f432-5cd4-9611-bd774afb417a
  │   Device Flags:       • Internal device
  │                       • Updatable
  │                       • System requires external power source
  │                       • Supported on remote server
  │                       • Needs a reboot after installation
  │                       • Device is usable for the duration of the update
  │
  ├─ThinkPad T460s Corporate ME Update:
  │     New version:      184.83.3874
  │     Remote ID:        lvfs
  │     Summary:          Lenovo ThinkPad T460s Corporate ME Firmware
  │     License:          Proprietary
  │     Size:             7.5 MB
  │     Created:          2016-07-08
  │     Urgency:          High
  │     Details:          https://pcsupport.lenovo.com/de/en/search?query=N1CRG67W
  │     Vendor:           Lenovo Ltd.
  │     Flags:            is-upgrade
  │     Description:
  │     • 8 Intel Platform Update 2020.2 HF2 Release
  │
  │     Version 11.8.83.3874 (LVFS: 184.83.3874)
  │
  │     Problem Fixes
  │
  │     • Mitigated several security vulnerabilities.  Please see details under "Fixed Issues".
  │
  └─ThinkPad T460s Corporate ME Update:
        New version:      184.80.3746
        Remote ID:        lvfs
        Summary:          Lenovo ThinkPad T460s Corporate ME Firmware
        License:          Proprietary
        Size:             7.5 MB
        Created:          2016-07-08
        Urgency:          High
        Details:          https://pcsupport.lenovo.com/de/en/search?query=N1CRG65W
        Vendor:           Lenovo Ltd.
        Flags:            is-upgrade
        Description:
        • 8 Intel Platform Update 2020.2 Release        Version 11.8.80.3746 (LVFS: 184.80.3746)        Problem Fixes        • Mitigated the following security vulnerabilities under issues:

更新設備固件

最後要下載並應用系統的所有更新,請使用 update 選項。

$ fwupdmgr update

  • 可以實時應用的更新將立即完成。
  • 在啟動時運行的更新將在下次重啟時暫存。

輸出:

Devices with no available firmware updates:
 • SC300B HFS256G39MND-3510B
 • System Firmware
 • UEFI dbx
Upgrade available for Intel Management Engine from 184.79.3722 to 184.83.3874
20F90044GE must remain plugged into a power source for the duration of the update to avoid damage. Continue with update? [Y|n]: Y
Downloading…             [*                                      ] Less than one minute remaDownloading…             [**                                     ] Less than one minute remaDownloading…             [**                                     ] Less than one minute remaDownloading…             [***                                    ] Less than one minute remaDownloading…             [****                                   ] [******************************         ] Less than one minute remaDownloading…             [*******************************        ] Less than one minute remaDownloading…             [***************************************]
Decompressing…           [***************************************]
Authenticating…          [***************************************]
Authenticating…          [***************************************]
Updating Intel Management Engine…********************************]
Scheduling…              [***************************************]
Successfully installed firmwareAn update requires a reboot to complete. Restart now? [y|N]:

系統重新啟動後,我們會將硬件固件更新到最新的可用版本。

結論

在本教程中,我們學習瞭如何使用 fwupd 在 Ubuntu 系統上更新固件。

您還可以使用最流行的軟件管理器前端執行固件更新,例如 GNOME Software、KDE ​​Discover 和 Wyse Management Suite。

此外,fwupd 項目鼓勵用戶向 LVFS 報告成功和失敗的更新。 這是一項可選功能,但值得鼓勵,因為它為 LVFS 管理員和 OEM 開發人員提供了有關固件更新過程效率的寶貴反饋。 您可以使用以下方式發送報告:

$ fwupdmgr report-history

感謝閱讀,請讓我們知道您的 Linux 系統上的固件更新情況如何。