-
Notifications
You must be signed in to change notification settings - Fork 14
Add build_id placeholder to contents.xml #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, thanks! Two requests:
-
could you mention the filename fix in the PR description
-
could you add a --build-id or similar flag to gen_contents.py to set the output value? This would avoid having to sed this in qcom-deb-images and meta-qcom, and that would also give us the opportunity to replace @BUILD_ID@ with an empty string when unset, which would give a somewhat file to use with Axiom if people run this by hand
Thanks!
Actually just realized that you might also want a BUILD_ID option in the Makefile so that "make BUILD_ID=foo" generates the files with the right id (we still want the gen_contents --build-id flag though) |
Sure, I'll enhance both gen_contents.py script & makefile to accept BUILD_ID. I moved the filenames fix to #39 So that it can merge independently. |
Thinking about it... Maybe it's not a correct idea. The build-id comes from the firmware / rootfs / final build stage. Inside qcom-ptool we don't know this ID (and I don't think we should be reruning ptool generation each time the ID changes). |
(I don't understand!) ptool is where we the script that generates contents.xml lies, and build-id is in the contents.xml. The flag can be empty or not specified, and the default behavior can be the one you describe, but if we don't have the flag, that means we have to post-process the xml in meta-qcom and qcom-deb-images instead of simply passing the build-id from these while we generate the contents.xml. It's not hard, but it feels unneeded when we are doing xml parsing to adjust a few things in this script already?! |
Well... we might be generating contents.xml too early. I'm thinking from the OE point of view. There partitions and contents.xml files are generated via the recipe. The generated files should not contain a fixed build ID. Later, when the code combines rootfs, boot image, firmware into the archive, then it's the time to set the build ID. |
@lumag Agreed, perhaps contents.xml should indeed be generated quite late as for the build-id to be meaningful and related to the integrated use case. In the Debian case, we generate rootfs, then filesystem / disk images, then flat images and it's at this third stage that we call ptool, just before sending these flat images for testing to LAVA and in the future Axiom. I guess Yocto is building software, then building images, with ptool generated being just an input to the image; perhaps the ptool/contents.xml generation should be closer to image generation in Yocto/OE world too? |
No, it's a low-level artifact, so it should also be generated pretty early. I don't see a need to regenerate partition, GPT or contents files if the only change is the build ID. We are doing some preprocessing on the files anyway, when generating the final archive, so why not fix the build ID at that point too? |
Different user experiences / distro experiences might customize e.g. the list of partitions; I think that would call for running ptool later. Again, I could also post-process the files, I just don't see what we would lose by having this ability to set the build-id if we know it when calling gen_contents.py; it's de factor where we are worrying about what a well formed file looks like. |
Latest changes from @vkraleti works with both cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, suggested a small improvement to Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out the proposed branch, and built with make
and make BUILD_ID=foobar
and I could see a build_id element being created with foobar in the second case, and with @BUILD_ID@ in the first case
Small things:
-
Makefile uses BUILD_ID but gen_contents.py uses BUILDID, they should either be the same or more different :)
-
I don't think "@buildid@" is nice in the resulting contents.xml when it's unset; I believe if that's meant to make the job of post-processing easier, these tools can call
make BUILD_ID=@BUILDID@
and achieve the same results. I believe we should default to either not setting the build_id element at all when-b
isn't set, or default to an empty build_id -
how could we make the Makefile BUILD_ID setting a bit more visible to end-users? Should there be something at the top of Makefile like:
# optional build_id for Axiom contents.xml files
BUILD_ID ?=
Axiom requires a unique identifier (build_id) to track published artifacts. Values like github.run_id or build path can be used as build_id. Since these are not accessible at the ptool repo level, add a parameter to accept the value and update actual build_id in contents.xml during the final build stage. Signed-off-by: Viswanath Kraleti <[email protected]>
Update the `clean` target to correctly remove generated `.xml` and `.bin` files from nested subdirectories under `platforms/*/[emmc|ufs]` paths. Signed-off-by: Viswanath Kraleti <[email protected]>
Add support for passing an optional `build_id` argument to the Makefile, which in turn used by gen_contents.py to add unique build_id into the generated `contents.xml`, as required by Axiom. Signed-off-by: Viswanath Kraleti <[email protected]>
@lool acted on your comments, can you check now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @vkraleti, thanks for the polish!
I've rested with make
(empty <build_id/>) and make BUILD_ID=foobar
, and both worked as we discussed.
Axiom requires a unique identifier (build_id) to track published artifacts. Since values like github.run_id or build path are not
accessible at the ptool repository level, add a placeholder field in contents.xml.
The actual build_id can be injected during the final build stage in meta-qcom by passing "BUILD_ID=" to make.
Initial change to fix qualcomm-linux/meta-qcom#1081