Skip to content

Commit 1f2bccd

Browse files
committed
debos: image: Copy DTBs to ESP partition
Install u-boot-efi-dtb to copy kernel DTBs to ESP partition and keep them updated. This allows U-Boot to pick them up on boot on RB1. Make the first copy from the debos recipe as this might not always happen depending on the debos backend used. Signed-off-by: Loïc Minier <[email protected]>
1 parent e0567df commit 1f2bccd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,27 @@ actions:
6969
# Depends on grub packages
7070
- shim-signed-
7171

72+
# this is to provide an updated copy of DTBs from the OS to U-Boot, notably
73+
# on RB1
74+
- action: run
75+
description: Setup copying of DTBs to ESP partition
76+
chroot: true
77+
command: |
78+
set -eux
79+
# u-boot-efi-dtb installs a kernel hook that will trigger on kernel
80+
# installation/upgrade, but also calls it explicitely in its postinst in
81+
# case it was installed after the kernel; it requires an ESP partition to
82+
# copy the DTBs though, so install it after the ESP partition is
83+
# available
84+
apt -y install u-boot-efi-dtb
85+
# when building under debos, /sys/firmware/efi is not always present, so
86+
# the u-boot-efi-dtb postinst doesn't install an initial copy of the
87+
# DTBs; do this once here
88+
latest_kernel="$(
89+
linux-version list | linux-version sort --reverse | head -1)"
90+
dtb_path="/usr/lib/linux-image-${latest_kernel}"
91+
cp -RT "$dtb_path" "/boot/efi/dtb"
92+
7293
- action: run
7394
description: Create task to grow root filesystem on first boot
7495
chroot: true

0 commit comments

Comments
 (0)