OE4T / meta-tegra

BSP layer for NVIDIA Jetson platforms, based on L4T
MIT License
419 stars 230 forks source link

kernel-bup-payload fails for xavier nx #869

Closed rytec-nl closed 2 years ago

rytec-nl commented 2 years ago

Describe the bug I'm trying to update our jetson-xavier-nx-devkit-emmc image from dunfell-r32.5.0 to dunfell (r32.6.0) but am getting an error in the kernel-bup-payload.bb do_deploy step:

| creating xusb payload
|
| File /yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/signed/xusb_sil_rel_fw_sigheader.encrypt does not exist
| PARTITION INFO   :                    signed/xusb_sil_rel_fw_sigheader.encrypt xusb-fw 3261 0 common
| Traceback (most recent call last):
|   File "/yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/BUP_generator.py", line 659, in <module>
|     main(param)
|   File "/yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/BUP_generator.py", line 652, in main
|     generate_BUP(arg)
|   File "/yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/BUP_generator.py", line 175, in generate_BUP
|     payload_obj.fill_image(blob)
|   File "/yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/BUP_generator.py", line 293, in fill_image
|     binary_handle = open(entry_info[0], 'rb')
| TypeError: expected str, bytes or os.PathLike object, not NoneType
|
| FAILURE: xusb_only_payload not created

It seems related to this issue, however for me the signing steps completes without an error:

...
| [   3.8830 ] Copying signed file in /yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/signed
| [   4.0526 ] tegraparser_v2 --pt flash.xml.bin --generateflashindex /yocto/yocto-configurations/nvidia/jetson-xavier-nx/tmp/work/jetson_xavier_nx_devkit_emmc-poky-linux/kernel-bup-payload/1.0-r0/bup-payload/signed/flash.xml.tmp flash.idx
| [   4.3445 ]
|
| signing images succeeded
...

I can only find references to xusb_sil_rel_fw in recipes, could it be that an extra signed file was added? Or am I simply missing a migration step.

To Reproduce Steps to reproduce the behavior:

  1. Build meta-tegra branch 'dunfell' with jetson-xavier-nx-devkit-emmc based on core-image-x11
  2. Build with bitbake argument 'core-image-x11'

Aditional context

Please let me know if additional info is needed or I need to check something.

Thanks in advance!

Rens

edit:

I now see this in the wiki, but not that I should do anything because of it. Is there a step needed for the change?

madisongh commented 2 years ago

I now see this in the wiki, but not that I should do anything because of it. Is there a step needed for the change?

If you're using a custom flash layout XML that you created with the older BSP version, you need to update it as mentioned in that section of the wiki page. Based on the error you're seeing, that looks like the problem.

If you don't think you're using a custom flash layout, maybe it's being introduced by another layer you're including in your builds?

rytec-nl commented 2 years ago

Hi,

Thanks for you quick reply! And you hit the mark :) I forgot to update the meta-mender-community/meta-mender-tegra layer. Doing so fixes it.

Thanks a lot!

paroque28 commented 5 months ago

@madisongh Do you know any other reason why this error might occur?

I have the latest dunfell commits for everything (meta-tegra, meta-tegra-community, meta-mender, meta-mender-community, poky, oe...)

And I keep getting:

| creating xusb payload
| File .../build/tmp/work/jetson-xavier-nx-devkit-emmc/kernel-bup-payload/1.0-r0/bup-payload/signed/xusb_sil_rel_fw_sigheader.encrypt does not exist

I didn't find this file or any reference to it. I would appreciate if you point me in the right direction. Maybe who's generating that file Thank you!!

dwalkes commented 5 months ago

@paroque28 I think you need to follow the instructions at https://github.com/OE4T/meta-tegra/wiki/L4T-R32.6.1-Notes#flash-layout-file-changes-for-t194-xavier-platforms linked above regarding any custom flash layouts in your layer:

The flash layout XML files for the Xavier platforms in the L4T BSP have been modified to include new attributes (but no location/size changes). In particular, the xusb-fw partition is now marked oem_signed="true", as cboot now performs signature validation on the USB controller firmware.

See example at https://github.com/mendersoftware/meta-mender-community/blame/kirkstone/meta-mender-tegra/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-emmc/flash_mender.xml#L217 - if your layer overrides this layout you need to make the same changes in your layer.

paroque28 commented 5 months ago

@dwalkes I am using this same xml, same example that you mentioned without modifications, just that I am using the dunfell instead of kirkstone branch (it also has the oem_signed="true"). Unfortunately, no luck. Thanks for the suggestion

dwalkes commented 5 months ago

@paroque28 the last thing I'd suggest is to attempt to reproduce on tegra-demo-distro with the same config. If that works you could look at differences with your layer. If that doesn't work either you'd need to go back in history or, preferably, update to Kirkstone

paroque28 commented 5 months ago

@dwalkes I didn't try tegra-demo-distro but I checked out the meta-mender commits that tegra-demo-distro is using:

meta-mender @ 35886d9 meta-mender-community @ dd4621c

That solved my issue.