Skip to content

Instantly share code, notes, and snippets.

@derjohn
Last active March 27, 2024 19:05
Show Gist options
  • Save derjohn/2c19554415cea09830225314c2072807 to your computer and use it in GitHub Desktop.
Save derjohn/2c19554415cea09830225314c2072807 to your computer and use it in GitHub Desktop.
Update your Huawei Matebook Pro X (and others) from the Linux shell with fwupd

Huawei Matebook BIOS update with Linux

Tested with Huawei Matebook X Pro (MACH-WX9) This is more or less a step by step tutorial, written 02/2021. Sadly at the moment Huawei does not ship a package in Linux Vendor Firmware Service.

WARNING

Please note that you can damage ("brick") your device if something goes wrong or is done incorrectly. This is for the advanced user! I can only say that I flashed the new firmware 0.1.33 to my MACH-WX9 successfully.

Original docs

dennemann.blog THX!!!

Identify your Device (with lshw)

sudo apt install lshw
sudo lshw
...
       description: Motherboard
       product: MACH-WX9  # <=== !!!
       vendor: HUAWEI
...
     *-firmware
          description: BIOS
          vendor: HUAWEI
          physical id: 0
          version: 1.18
          date: 08/30/2018

Side-Note: BIOS version of firmware 0.1.24 does not match the firmware version. With firmware 0.1.33 Huawei shipped also BIOS 1.33.

Install Firmware Packager

sudo apt install fwupd # the packager script is shipped with the fwupd package, at least with the package in Ubuntu Bionic.
sudo apt install gcab p7zip-full python3

Fetch current firmware for your Matebook

Firmware Download URLs

Firmware GUID

fwupdmgr get-devices
MACH-WX9 System Firmware
  Guid:                 085c293a-051a-4cc2-b0a5-0ddb7105fdbf

Packaging Step

Find the UEFI FD File

Important: You need to tell the packager where to find the UEFI Flash Descriptor ("FD"). The location changed since 0.1.24, now with 0.1.33 you find it like this:

7z x MateBook_X_Pro_BIOS_1.33.zip
cd MateBook_X_Pro_BIOS_1.33/
7z x MateBook_X_Pro_BIOS_1.33.zip
7z x MHIKR133.exe
7z x BIOS_1.33.exe

There it is: UEFI_FW.bin

Check, if there is an FD file layout inside:

7z l UEFI_FW.bin

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
                    .....        19328        19328  .text
                    .....          608          608  UEFI_FW
                    .....          224          224  .xdata
                    .....      7521664      7521664  .reloc
                    .....         1456         1456  CERTIFICATE
------------------- ----- ------------ ------------  ------------------------
                               7543280      7543280  5 files

Create .cab file with the firmware

/usr/share/fwupd/firmware-packager --firmware-name HuaweiBIOS --device-guid 085c293a-051a-4cc2-b0a5-0ddb7105fdbf --developer-name Huawei --release-version 0.1.33 --exe ./BIOS_1.33.exe --bin ./UEFI_FW.bin --out firmware_bios_update.cab

Using temp directory ... 
Extracting firmware exe
Locating firmware bin
Creating metainfo
Cabbing firmware files
Done

Flash step

sudo fwupdmgr install ./firmware_bios_update.cab 
Decompressing…           [***************************************]
Authenticating…          [***************************************]
Installing on MACH-WX9 System Firmware…                          ]
Scheduling…              [***************************************]

An update requires a reboot to complete. Restart now? [Y|n]:

Then the system needs to be rebooted and F12 must be pressed, to choose booting the updater, which is located on the NVME (EFI Partition) in the menu.

@derjohn
Copy link
Author

derjohn commented Mar 27, 2024

@exioz THX for the kudos <3 <3 <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment