66{{- if .u_boot_rb1 -}}
77{{- $build_rb1 = "true" }}
88{{- end -}}
9+ {{- $buildid := or .buildid "" }}
910
1011architecture : arm64
1112
@@ -251,6 +252,13 @@ actions:
251252 " ${QCOM_PTOOL}/gen_contents.py" -p ptool-partitions.xml \
252253 -t "$contents" \
253254 -o contents.xml
255+ # XXX insert build_id element before windows_root_path;
256+ # this will be nicer to do when gen_contents.py supports
257+ # setting this; see also:
258+ # https://github.com/qualcomm-linux/qcom-ptool/pull/38
259+ sed -i \
260+ " /windows_root_path/ i \t\t\t\t <build_id>{{$buildid}}</build_id>" \
261+ contents.xml
254262 fi
255263 # generate flashing files from qcom-partitions.xml
256264 " ${QCOM_PTOOL}/ptool.py" -x ptool-partitions.xml
@@ -263,6 +271,17 @@ actions:
263271 # copy platform partition files
264272 cp --preserve=mode,timestamps -v build/ptool/{{ $board.platform }}/* \
265273 " ${flash_dir}"
274+ # adjust paths in contents.xml to use board-specific flash_* subdir
275+ if [ -e "${flash_dir}/contents.xml" ]; then
276+ # one set of backslashes for shell quoting, another one for sed
277+ # parsing
278+ windows_path=".\\\\flash_{{ $board.name }}\\\\"
279+ linux_path="./flash_{{ $board.name }}/"
280+ sed -i \
281+ -e "s:<windows_root_path>.*:<windows_root_path>${windows_path}</windows_root_path>:" \
282+ -e "s:<linux_root_path>.*:<linux_root_path>${linux_path}</linux_root_path>:" \
283+ " ${flash_dir}/contents.xml"
284+ fi
266285 # remove BLANK_GPT and WIPE_PARTITIONS files as it's common for people
267286 # to run "qdl rawprogram*.xml", mistakingly including these; perhaps
268287 # ptool should have a flag not to generate these; note that there are
0 commit comments