Skip to content

Commit 25025c6

Browse files
committed
Redo RB1 flat image using purely the rescue
Signed-off-by: Loïc Minier <[email protected]>
1 parent 93fa2bd commit 25025c6

File tree

1 file changed

+24
-35
lines changed

1 file changed

+24
-35
lines changed

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

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -50,46 +50,35 @@ actions:
5050
# unpack rescue image
5151
unzip -j "${ROOTDIR}/../qrb2210-rb1_rescue-image.zip" \
5252
-d build/qrb2210-rb1_rescue-image
53-
# generate partition files
54-
mkdir -v build/qrb2210-rb1_partitions
55-
(
56-
cd build/qrb2210-rb1_partitions
57-
conf="${QCOM_PTOOL}/platforms/qrb2210-rb1/partitions.conf"
58-
"${QCOM_PTOOL}/gen_partition.py" -i "$conf" \
59-
-o ptool-partitions.xml
60-
# partitions.conf sets --type=emmc, nand or ufs
61-
if grep -F '^--disk --type=ufs ' "${conf}"; then
62-
touch flash-ufs
63-
elif grep -F '^--disk --type=emmc ' "${conf}"; then
64-
touch flash-emmc
65-
fi
66-
"${QCOM_PTOOL}/ptool.py" -x ptool-partitions.xml
67-
)
53+
# TODO: on RB1, we don't generate partition files with ptool since its
54+
# partitions.conf does not have entries for data files from the rescue
55+
# image, while the rescue image defines useful partitions such as the ESP
6856
flash_dir="${ARTIFACTDIR}/flash_rb1"
6957
rm -rf "${flash_dir}"
7058
mkdir -v "${flash_dir}"
71-
# copy partition files
72-
cp --preserve=mode,timestamps -v build/qrb2210-rb1_partitions/* \
59+
# copy rescue image files
60+
cp --preserve=mode,timestamps -v build/qrb2210-rb1_rescue-image/* \
7361
"${flash_dir}"
74-
# copy rescue binaries; skip partition files
75-
find build/qrb2210-rb1_rescue-image \
76-
-not -name 'gpt_*' \
77-
-not -name 'patch*.xml' \
78-
-not -name 'rawprogram*.xml' \
79-
-not -name 'wipe*.xml' \
80-
-not -name 'zeros_*' \
81-
\( \
82-
-name LICENSE \
83-
-or -name 'prog_*' \
84-
-or -name '*.bin' \
85-
-or -name '*.elf' \
86-
-or -name '*.fv' \
87-
-or -name '*.mbn' \
88-
\) \
89-
-exec cp --preserve=mode,timestamps -v '{}' "${flash_dir}" \;
62+
# copy RB1 U-Boot binary to u-boot-abootimg.img
63+
cp --preserve=mode,timestamps -v "{{- .u_boot_rb1 -}}" \
64+
"${flash_dir}/u-boot-abootimg.img"
65+
66+
# update flashing file for RB1 U-Boot; in the rescue image, this
67+
# partition is blanked with boot-erase.img
68+
sed -i '/label="boot_a"/s/filename="[^"]*"/filename="u-boot-abootimg.img"/' "${flash_dir}"/rawprogram*.xml
69+
70+
# update flashing files for ESP image; in the rescue image, this
71+
# partition is blanked with boot-erase.img
72+
sed -i '/label="esp"/s#filename="[^"]*"#filename="../disk-sdcard.img1"#' "${flash_dir}"/rawprogram*.xml
73+
74+
# update flashing files for rootfs image;; in the rescue image, this
75+
# partition is not provisioned
76+
sed -i '/label="rootfs"/s#filename="[^"]*"#filename="../disk-sdcard.img2"#' "${flash_dir}"/rawprogram*.xml
77+
78+
# TODO: there is currently no dtb.bin alike system with the RB1 firmware
9079

91-
# TODO: currently not providing CDT; it's present in 96Boards'
92-
# RB1_firmware_20231124-v4.zip but not in Linaro's
80+
# TODO: currently not providing CDT; it's present in
81+
# RB1_firmware_20231124-v4.zip but not in
9382
# rb1-bootloader-emmc-linux-47528.zip
9483
{{- end -}}
9584

0 commit comments

Comments
 (0)