Skip to content

Commit 321612d

Browse files
authored
Merge pull request #39 from b49020/sumit/fwupd
U-Boot RB1: Add support for EFI firmware capsule updates via fwupdtool
2 parents ced4b83 + 89a10c4 commit 321612d

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

.github/workflows/u-boot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070
u-boot/u-boot-nodtb.bin.gz-dtb \
7171
u-boot/u-boot.bin \
7272
u-boot/rb1-boot.img \
73+
u-boot/u-boot-cap.bin \
74+
u-boot/u-boot.cab \
7375
${BUILD_DIR}
7476
# perhaps help NFS sync
7577
sync

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ Initially, this repository provides [debos](https://github.com/go-debos/debos) r
66

77
We are also working towards providing ready-to-use, pre-built images – stay tuned!
88

9+
## Firmware updates
10+
11+
On standard Linux distros like Debian, firmware updates are generally delivered via Linux Vendor Firmware Service ([LVFS](https://fwupd.org/)). The OEM/ODM vendors usually upload latest firmware releases on LVFS (refer [here](https://lvfs.readthedocs.io/en/latest/upload.html)) as cabinet (.cab) firmware archive files containing at least one metadata (.metainfo.xml) file describing the firmware update. On the device, fwupd is installed which provides a system-activated daemon listening on D-Bus for installing any firmware updates.
12+
13+
### Firmware delivery
14+
15+
On a Desktop system, its usually GNOME Software which monitors LVFS for any firmware updates and pushes to fwupd if any. On a headless system like most embedded devices, the fwupdmgr command line tool can be used to monitor LVFS for firmware updates as follows:
16+
17+
```bash
18+
# Download latest metadata from LVFS
19+
fwupdmgr refresh
20+
21+
# Fetch device specific firmware updates from LVFS
22+
fwupdmgr get-updates
23+
24+
# Install firmware updates
25+
fwupdmgr update
26+
```
27+
28+
### Firmware on devices supported by Qualcomm Linux
29+
30+
The firmware on Qualcomm devices is expected to support UEFI UpdateCapsule plugin for fwupd daemon. However, currently firmware for Qualcomm devices in not available in LVFS which is a work in progress as of now. In order to play with UEFI firmware capsule updates, one can use fwupdtool to locally update firmware like on RB1 as follows:
31+
32+
```bash
33+
# Transfer U-Boot firmware cabinet archive build from scripts/build-u-boot-rb1.sh to RB1
34+
sudo fwupdtool install u-boot.cab
35+
# It will ask for a reboot for the UEFI firmware capsule update to happen
36+
```
37+
938
## Branches
1039

1140
main: Primary development branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch.

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ actions:
3636
- dosfstools
3737
# ext4 tools, notably e2fsck for the root filesystem
3838
- e2fsprogs
39+
# fwupd tools, enable OTA EFI firmware capsule updates
40+
- fwupd
3941
# defaults to "systemd-sysv"; perhaps not needed
4042
- init
4143
# Ethernet, Wi-Fi, WWAN; built-in DHCP client

scripts/build-u-boot-rb1.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ U_BOOT_DEVICE_TREE="qcom/qrb2210-rb1"
1313
ABOOT_BASE_ADDRESS="0x80000000"
1414
ABOOT_PAGE_SIZE="4096"
1515
ABOOT_OUTPUT="rb1-boot.img"
16+
CAPSULE_OUTPUT="u-boot-cap.bin"
17+
CABINET_OUTPUT="u-boot.cab"
1618

1719
log_i() {
1820
echo "I: $*" >&2
@@ -34,6 +36,8 @@ packages="${packages} make bison flex bc libssl-dev gnutls-dev xxd"
3436
packages="${packages} coreutils"
3537
# needed to pack resulting u-boot binary into an Android boot image
3638
packages="${packages} gzip mkbootimg"
39+
# needed to build fwupd cabinet archive for EFI firmware capsule updates
40+
packages="${packages} fwupd"
3741

3842
log_i "Checking build-dependencies ($packages)"
3943
missing=""
@@ -89,3 +93,25 @@ mkbootimg --base "${ABOOT_BASE_ADDRESS}" \
8993
--ramdisk empty-ramdisk \
9094
--output "${ABOOT_OUTPUT}"
9195

96+
# EFI firmware capsule and fwupd cabinet files generation. Note that currently
97+
# only U-Boot firmware can be updated using capsule updates without support for
98+
# dual bank (A/B) capsule updates. The next steps is to add support for dual
99+
# bank capsule updates as well as support to update Qualcomm downstream boot
100+
# firmware too.
101+
102+
# The GUID used below for U-Boot firmware can be generated dynamically via:
103+
# $ ./tools/mkeficapsule guidgen dts/upstream/src/arm64/qcom/qrb2210-rb1.dtb UBOOT_BOOT_PARTITION
104+
# Generating GUIDs for qcom,qrb2210-rb1 with namespace 8c9f137e-91dc-427b-b2d6-b420faebaf2a:
105+
# UBOOT_BOOT_PARTITION: 77F90B51-588C-5EF0-AAB9-046AEB2AC8C5
106+
107+
./tools/mkeficapsule \
108+
--index 1 \
109+
--instance 0 \
110+
--guid 77F90B51-588C-5EF0-AAB9-046AEB2AC8C5 \
111+
"${ABOOT_OUTPUT}" \
112+
"${CAPSULE_OUTPUT}"
113+
rm -f "${CABINET_OUTPUT}"
114+
fwupdtool build-cabinet \
115+
"${CABINET_OUTPUT}" \
116+
"${CAPSULE_OUTPUT}" \
117+
board/qualcomm/u-boot-cap.metainfo.xml

0 commit comments

Comments
 (0)