Fwupd

From postmarketOS

This article is about upgrading firmware on your postmarketOS installation with fwupd. Several postmarketOS devices support firmware upgrades through fwupd such as the PinePhone (Pro), SHIFT6mq and more.

fwupd frontends

fwupd can be used with several frontends:

  • fwupdmgr (CLI)
  • KDE Discover
  • GNOME Software
  • GNOME Firmware Updater

For now it is recommended to make the firmware upgrades through fwupdmgr or GNOME Firmware Updater. Other interfaces are not tested as well, and may not yet support newer features of fwupd, such as swichting branches.

Upgrading ABL firmware on the SHIFT6mq

The SHIFT6mq uses, like other SDM845 devices, ABL (Android BootLoader) from Qualcomm as bootloader. It can be upgraded as on Android through fwupd with the android-boot plugin which is available from fwupd 1.8.5 or later.

To get the latest firmware for ABL on the SHIFT6mq, you can run:

$ sudo fwupdmgr upgrade

Upgrading Tow-Boot on the PinePhone (Pro)

fwupd 1.8.5 gained support for updating Tow-Boot on the PinePhone (Pro). It leverages either the mtd (SPI flash) or android-boot (eMMC boot partition) plugins to flash Tow-Boot. You need Tow-Boot with uSWID data embedded for this to work (Tow-Boot 2021.10-006 or higher), if you don't have this version yet, you need to flash it still with the Tow-Boot installer.

To get the latest Tow-Boot platform firmware for the Pine64 PinePhone (Pro), you can run:

$ sudo fwupdmgr upgrade

Upgrading Modem Firmware on the PinePhone (Pro)

The primary use case of fwupd for the PinePhone (Pro) is upgrading the EG25-G modem from the stock firmware to Biktor's alternative firmware that has several stability improvements. This feature is available in postmarketOS v22.06 and higher.

Preparations

  • Make sure your phone is charged
  • Plug the charger while doing this

fwupdmgr

Verify that fwupdmgr detects the EG25-G modem. If it does not, you may need to reboot first (e.g. if fwupd packages were just installed):

$ sudo fwupdmgr get-devices
WARNING: This package has not been validated, it may not work properly.
Pine64 PinePhone (1.2) 
│
└─QUECTEL Mobile Broadband Module:
      Device ID:          976c4a39e87f61e6940ea6a8d39c583cfa99615f
      Summary:            Quectel EG25-G modem
      Current version:    EG25GGBR07A08M2G_01.001.01.001
      Vendor:             QUALCOMM INCORPORATED (USB:0x2C7C)
      GUIDs:              db379a33-254f-5140-b37e-d36ae7e5c039
                          d18f31f1-a3fa-55a2-b4ed-decfbc1e004d
                          1a2996cb-f86e-5583-a464-e1b96e1c6ae9
                          587bf468-6859-5522-93a7-6cce552a0aa3
                          22ae45db-f68e-5c55-9c02-4557dca238ec
      Device Flags:       • Updatable
                          • System requires external power source
                          • Supported on remote server
                          • Device supports switching to a different branch of firmware
$ sudo fwupdmgr refresh --force
WARNING: This package has not been validated, it may not work properly.
Updating lvfs-testing
Downloading…             [***************************************]
Downloading…             [***************************************]
Updating lvfs
Downloading…             [***************************************]
Downloading…             [***************************************]
Successfully downloaded new metadata: 1 local device supported


Do the initial upgrade with switching the branch. This will take about 10 minutes (and yes, it says "downgrade" initially). You can find information about Biktor's releases here. Make sure to replace <DEVICE-ID> in the following command with the "Device ID:" from fwupdmgr get-devices output.

sudo fwupdmgr switch-branch <DEVICE-ID>                                                                                                                                                                                                                               
[sudo] password for user:                                                                                                                                      
WARNING: This package has not been validated, it may not work properly.                                                                                        
╔══════════════════════════════════════════════════════════════════════════════╗                                                                               
║ Switch branch from default to community?                                     ║                                                                               
╠══════════════════════════════════════════════════════════════════════════════╣                                                                               
║ The firmware from Pine64 is not supplied by QUALCOMM INCORPORATED, the       ║                                                                               
║ hardware vendor.                                                             ║                                                                               
║                                                                              ║                                                                               
║ Your hardware may be damaged using this firmware, and installing this        ║                                                                               
║ release may void any warranty with QUALCOMM INCORPORATED.                    ║                                                                               
║                                                                              ║                                                                               
║ This release brings the following fixes and improvements:                    ║                                                                               
║                                                                              ║                                                                               
║ • Allow calls to be delayed for more than 999 seconds                        ║                                                                               
║ • Ensure we send a RING_IN pulse to the Pinephone when making simulated      ║                                                                               
║ calls, to be able to wake the Pinephone from crust                           ║                                                                               
║ • Force resync of the RT5616 registers in the external codec (Pinephone      ║                                                                               
║ Pro) so call audio keeps working after suspend                               ║                                                                               
╚══════════════════════════════════════════════════════════════════════════════╝                                                                               
                                                                               
Do you understand the consequences of changing the firmware branch? [y|N]: y   
╔══════════════════════════════════════════════════════════════════════════════╗                                                                               
║ Downgrade QUECTEL Mobile Broadband Module from                               ║                                                                               
║ EG25GGBR07A08M2G_01.001.01.001 to 0.5.9?                                     ║                                                                               
╠══════════════════════════════════════════════════════════════════════════════╣                                                                               
║ This release brings the following fixes and improvements:                    ║                                                                               
║                                                                              ║                                                                               
║ • Allow calls to be delayed for more than 999 seconds                        ║                                                                               
║ • Ensure we send a RING_IN pulse to the Pinephone when making simulated      ║                                                                               
║ calls, to be able to wake the Pinephone from crust                           ║                                                                               
║ • Force resync of the RT5616 registers in the external codec (Pinephone      ║                                                                               
║ Pro) so call audio keeps working after suspend                               ║                                                                               
║                                                                              ║                                                                               
║ This firmware is provided by LVFS community members and is not provided (or  ║                                                                               
║ supported) by the original hardware vendor.                                  ║                                                                               
║                                                                              ║                                                                               
║ Installing this update may also void any device warranty.                    ║                                                                               
║                                                                              ║                                                                               
║ QUECTEL Mobile Broadband Module and all connected devices may not be usable  ║                                                                               
║ while updating.                                                              ║                                                                               
╚══════════════════════════════════════════════════════════════════════════════╝                                                                               
                                                                                                                                                               
Perform operation? [Y|n]: Y                                                                                                                                    
Downloading…             [***************************************] Less than one minute remaining…                                                             
Downloading…             [***************************************]                                                                                             
Decompressing…           [***************************************]                                                                                             
Decompressing…           [***************************************]                                                                                             
Authenticating…          [***************************************]                                                                                             
Authenticating…          [***************************************]                                                                                             
Restarting device…       [***************************************]                                                                                             
Writing…                 [***************************************]                                                                                             
Waiting…                 [***************************************] Less than one minute remaining…                                                             
Successfully installed firmware

Following upgrades can be done with fwupdmgr upgrade.

When there is nothing to do, you will see:

$ sudo fwupdmgr upgrade
WARNING: This package has not been validated, it may not work properly.
Devices with the latest available firmware version:
 • QUECTEL Mobile Broadband Module

Troubleshooting

If flashing fails for whatever reason, try hard rebooting the phone by powering off, taking the battery out, and powering the phone back on. Then you can use the flashall method as described in Biktor's release notes here.

See also