Skip to content

Commit e1e982b

Browse files
committed
scripts: u-boot-rb1: Support building EFI firmware updates
U-Boot qcom-mainline branch now got support for EFI firmware capsule updates. So let's add support to build EFI firmware capsule updates using tooling provided by U-Boot as well as fwupdtool to generate LVFS cabinet archive. Once that's done, the EFI firmware capsule updates can be installed and triggered on RB1 using fwupdtool as follows: $ sudo fwupdtool install u-boot.cab Signed-off-by: Sumit Garg <[email protected]>
1 parent 8a63334 commit e1e982b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-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

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)