Skip to content
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

Adding COMPATIBLE_SPEC support for BUP payloads #1135

Merged
merged 4 commits into from
Jan 14, 2023

Conversation

madisongh
Copy link
Member

@madisongh madisongh commented Jan 9, 2023

This is already present in the JetPack 5/R35.1.0-based branches, but was more involved for R32.7.x because:

  • More platforms are involved
  • tegra-boot-tools also needed updating

When using the stock NVIDIA bootloader update tools, the setup-nv-boot-control service will add a COMPATIBLE_SPEC line to the configuration file so that BUP payload entries either matching the actual TNSPEC or the compatible spec will be considered valid for an update. The new version of the tegra-bootloader-update tool implements similar logic for its compatibility checks.

With the above changes, the TEGRA_BUP_SPECS settings for all machines needed revising. In most cases, fewer specs are required, making BUP packages smaller and taking less time to build/sign.

For reviewing, I'd appreciate it if someone could cross check the setup-nv-boot-control.sh changes here (and the translation of the logic in that script to the C code here in tegra-boot-tools) to derive the compatible spec string against NVIDIA's implementation in their nv-l4t-bootloader-config.sh script. To get a copy of the NVIDIA script, extract it from the nvidia-l4t-init package, which you can download here, with:

   $ dpkg-deb --fsys-tarfile nvidia-l4t-init_32.7.2-20220417024839_arm64.deb | tar -x -f- --strip-components=4 ./opt/nvidia/l4t-bootloader-config/nv-l4t-bootloader-config.sh

The relevant function in that script is called generate_compatible_spec_info.

rather than using sed to essentially rewrite the entire config
file provided in the BSP package.

Signed-off-by: Matt Madison <matt@madison.systems>
This is similar to the nv-l4t-bootloader-config script used in
stock JetPack, providing a mechanism for reducing BUP payload
sizes by matching up binaries that are compatible across
module revisions.

Signed-off-by: Matt Madison <matt@madison.systems>
which brings in support for compatibility specs during BUP
processing.  License text changed only due to copyright year
update.

The git-based development recipe is updated accordingly,
bumping its PV and updating the license file checksum.

Signed-off-by: Matt Madison <matt@madison.systems>
Now that we have COMPATIBLE_SPEC support in the runtime bootloader
update tools, we can reduce the set of specs we need to account for
in the BUP payloads we build. The specs are more closely aligned
with those in the stock L4T BUP generation script.

Signed-off-by: Matt Madison <matt@madison.systems>
@madisongh madisongh force-pushed the wip-bup-compatible-spec-support branch from 2c766c6 to 08ac783 Compare January 12, 2023 17:57
@madisongh madisongh marked this pull request as ready for review January 12, 2023 18:08
@dwalkes
Copy link
Member

dwalkes commented Jan 12, 2023

Thanks @madisongh. I needed to use nvidia-l4t-init_32.7.2-20220420143418_arm64.deb with the dpkg-deb line above, so the full dpkg-deb command was:

dpkg-deb --fsys-tarfile nvidia-l4t-init_32.7.2-20220420143418_arm64.deb |  tar -x -f- --strip-components=4 ./opt/nvidia/l4t-bootloader-config/nv-l4t-bootloader-config.sh

I see the logic in update_jetson_xxx functions within nv-l4t-bootloader-config.sh which you changed from bash string checks to sh and grep. The logic looks correct to me.

I'll try testing this branch with tegrademo-mender next.

@madisongh
Copy link
Member Author

Thanks @dwalkes. Looks like I pasted in the link to the t210 version of that deb package, rather than the t186/t194 one. The script is the same in either one, though. I'll fix the link.

@dwalkes
Copy link
Member

dwalkes commented Jan 13, 2023

I'll try testing this branch with tegrademo-mender next.

Verified with jetson-agx-xavier-devkit.

LGTM, thanks @madisongh !

@madisongh madisongh merged commit e4869e9 into kirkstone-l4t-r32.7.x Jan 14, 2023
@madisongh madisongh deleted the wip-bup-compatible-spec-support branch January 14, 2023 17:25
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.

2 participants