Skip to content

Conversation

vkraleti
Copy link
Collaborator

The 'contents.xml' file maps images to their respective partitions in a format understood by Axiom. Deploy the same for supported platforms to enable Axiom automatic image flashing.

Copy link
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the contents.xml is still unexectedly bloated with DSP, BT and WiFi targets. We do not need those as those files are provided through the rootfs.

@vkraleti
Copy link
Collaborator Author

vkraleti commented Sep 1, 2025

@lumag @lool @ricardosalveti Based on your inputs and feedback from the test teams, I refined the contents template and rewrote gen_contents.py to generate contents.xml based on partitions.xml. There are no hard-coded build IDs anymore. Please check once.

Copy link
Contributor

@lool lool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, this is sooooo much better than the previous approach, thanks for writing this!

I've left some review comments on individual commits, on top of these:

  1. the contents.xml.in seem almost identical between qcs9100 and qcs6490; it seems the chipset name and the presence of a SAIL flashing stage are the only differences; could we:
  • have a single template with an optional SAIL section
  • read the chipset name from a trivial metadata file
  1. intuitively, the overall approach seems too verbose: many python lines to generate XML elements one by one; I'd have expected a much smaller lift from partitions.conf or partitions.xml to contents.xml; I wonder if this would have been simpler with simple templating like jinja2? Just an idea to make this simpler to read and hence maintain. :)

  2. I ran flake8 and pycodestyle and they found a few errors and a number of stylistic improvements; would you kindly review them?

flake8 output
lminier@LMINIER-mac qcom-ptool % flake8 gen_contents.py
gen_contents.py:9:1: F401 'xml.etree.ElementTree.Element' imported but unused
gen_contents.py:9:1: F401 'xml.etree.ElementTree.SubElement' imported but unused
gen_contents.py:11:1: E302 expected 2 blank lines, found 1
gen_contents.py:12:80: E501 line too long (112 > 79 characters)
gen_contents.py:12:98: E225 missing whitespace around operator
gen_contents.py:15:1: E302 expected 2 blank lines, found 1
gen_contents.py:27:1: E302 expected 2 blank lines, found 1
gen_contents.py:68:51: E231 missing whitespace after ','
gen_contents.py:72:80: E501 line too long (81 > 79 characters)
gen_contents.py:78:80: E501 line too long (83 > 79 characters)
gen_contents.py:86:51: E231 missing whitespace after ','
gen_contents.py:90:80: E501 line too long (83 > 79 characters)
gen_contents.py:99:51: E231 missing whitespace after ','
gen_contents.py:100:80: E501 line too long (87 > 79 characters)
gen_contents.py:101:80: E501 line too long (80 > 79 characters)
gen_contents.py:102:80: E501 line too long (84 > 79 characters)
gen_contents.py:104:80: E501 line too long (84 > 79 characters)
gen_contents.py:142:80: E501 line too long (83 > 79 characters)
gen_contents.py:145:80: E501 line too long (80 > 79 characters)
gen_contents.py:147:80: E501 line too long (80 > 79 characters)
gen_contents.py:154:1: E305 expected 2 blank lines after class or function definition, found 1
gen_contents.py:155:4: E111 indentation is not a multiple of 4
gen_contents.py:164:25: E225 missing whitespace around operator
gen_contents.py:166:30: E225 missing whitespace around operator
gen_contents.py:168:27: E225 missing whitespace around operator
gen_contents.py:175:11: F541 f-string is missing placeholders
gen_contents.py:178:11: F541 f-string is missing placeholders
pycodestyle output
gen_contents.py:11:1: E302 expected 2 blank lines, found 1
gen_contents.py:12:80: E501 line too long (112 > 79 characters)
gen_contents.py:12:98: E225 missing whitespace around operator
gen_contents.py:15:1: E302 expected 2 blank lines, found 1
gen_contents.py:27:1: E302 expected 2 blank lines, found 1
gen_contents.py:68:51: E231 missing whitespace after ','
gen_contents.py:72:80: E501 line too long (81 > 79 characters)
gen_contents.py:78:80: E501 line too long (83 > 79 characters)
gen_contents.py:86:51: E231 missing whitespace after ','
gen_contents.py:90:80: E501 line too long (83 > 79 characters)
gen_contents.py:99:51: E231 missing whitespace after ','
gen_contents.py:100:80: E501 line too long (87 > 79 characters)
gen_contents.py:101:80: E501 line too long (80 > 79 characters)
gen_contents.py:102:80: E501 line too long (84 > 79 characters)
gen_contents.py:104:80: E501 line too long (84 > 79 characters)
gen_contents.py:142:80: E501 line too long (83 > 79 characters)
gen_contents.py:145:80: E501 line too long (80 > 79 characters)
gen_contents.py:147:80: E501 line too long (80 > 79 characters)
gen_contents.py:154:1: E305 expected 2 blank lines after class or function definition, found 1
gen_contents.py:155:4: E111 indentation is not a multiple of 4
gen_contents.py:164:25: E225 missing whitespace around operator
gen_contents.py:166:30: E225 missing whitespace around operator
gen_contents.py:168:27: E225 missing whitespace around operator

@lool
Copy link
Contributor

lool commented Sep 1, 2025

Here are the generated contents.xml files from your branch for other reviewers to see how nice they now are:
contents.xml
contents.xml

@sbanerjee-quic sbanerjee-quic requested review from lool and lumag September 4, 2025 15:53
Copy link
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lool 's comments still apply.

@sbanerjee-quic
Copy link
Contributor

@lool
The current form the generated content XML does provide a viable minimum solution.
I propose we merge this and the open comments are documented as issue on this project which continues work.
Making this content XML available via meta-qcom will help kick off the test automation validation based on the nightly builds.

@ricardosalveti
Copy link
Contributor

Second patch, commit message, s/parition.xml/partition.xml/

Copy link
Contributor

@lool lool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for me except for the missing dependency on contents.xml.in in Makefile

I would prefer if we could share the contents.xml.in template across platforms, but if you want to do that in a followup PR, fine with me.

To improve build hygiene and to ensure partitions.xml is retained,
   - Add paritions.xml to the list of build targets to ensure
     the generated files are not automatically deleted.
   - Add 'clean' target to remove generated XML and binary files
     on demand.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
gen_contents.py accepts a contents template and partition.xml as inputs
and generates 'contents.xml' by updating image information in a format
compatible with Axiom for automatic image flashing.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Add a template which can be passed to gen_contents.py script,
to generate contents.xml suitable for QCS6490-RB3GEN2 boards.

The 'contents.xml' file maps images to their respective
partitions in a format understood by Axiom, which is helpful
to trigger automatic image flashing with Axiom.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Add a template which can be passed to gen_contents.py script,
to generate contents.xml suitable for QCS9100-RIDE boards.

The 'contents.xml' file maps images to their respective
partitions in a format understood by Axiom, which is helpful
to trigger automatic image flashing with Axiom.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Add a template which can be passed to gen_contents.py script,
to generate contents.xml suitable for QCS8300-RIDE boards.

The 'contents.xml' file maps images to their respective
partitions in a format understood by Axiom, which is helpful
to trigger automatic image flashing with Axiom.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
For platforms with a contents.xml.in avilable, generate
contents.xml from it using gen_contents.py

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Copy link
Contributor

@lool lool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me; I saw you added the targeted pycodestyle call, and the contents.xml.in dependency. I ran make lint and make integration tests successfully.

It would be nice to merge the contents.xml.in in a single template.

(I don't know how to test the resulting contents.xml files.)

@anshulg-qti
Copy link

Thanks, looks good to me; I saw you added the targeted pycodestyle call, and the contents.xml.in dependency. I ran make lint and make integration tests successfully.

It would be nice to merge the contents.xml.in in a single template.

(I don't know how to test the resulting contents.xml files.)

@vkraleti @quic-viskuma have worked with @smuppand and team to test them

@vkraleti
Copy link
Collaborator Author

vkraleti commented Sep 9, 2025

It would be nice to merge the contents.xml.in in a single template.

Created #31 to track single template ask.

@sbanerjee-quic sbanerjee-quic merged commit fc12ab8 into qualcomm-linux:main Sep 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants