How up to date is the documentation for l4_initrd_flash.sh? (Specifically, Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt)
I’ve managed to get it to work for the basic case, but some of the other “workflows” in the document have various problems.
For example, trying “workflow 12” - trying to write to a USB drive which sounds like (given the --direct flag) it should actually write to a drive on the host, I get an error related to APPSIZE when I try writing with the following command line:
[ 0.6655 ] tegraparser_v2 --generategpt --pt flash.xml.bin
[ 0.6658 ] End sector for APP, expected at: 122159070, actual: 0
Error: Return value 4
Command tegraparser_v2 --generategpt --pt flash.xml.bin
Error: /home/riz/testing/jetson_top_r35.4.1/Linux_for_Tegra/bootloader/signed/flash.idx is not found
Error: failed to relocate images to /home/riz/testing/jetson_top_r35.4.1/Linux_for_Tegra/tools/kernel_flash/images
Cleaning up...
… I tried replacing APPSIZE in the .xml file with no change in behavior. Is this stuff documented better somewhere? In the README, for example, in “Workflow 3” it says:
To flash to an externally connected storage device, you need to create your own
partition config xml file for the external device. For information about how to
do this, see the 'External Storage Device Partition' section in the developer
guide.
… there is no “External Storage Device Partition” in the Developer Guide for r35.4.1 that I can tell - at least searching that phrase didn’t reveal one. What section should I be looking at?
I should also ask, though - how do I increase the APPSIZE? I had to set the “size” parameter of the APP partition back to APPSIZE (from 85899345920) in order to get this to work, and I wound up with a 14GB partition instead of the 80GB one I was hoping for. I feel close, here, but the documentation is a bit all over the place, and it’s hard to figure out the right place to set this stuff.
Can you help me understand why you’re asking me to try with everything unmodified and using that command line? My goal here is to further understand the process so I can adapt it to my particular needs, and “just do what I wrote” doesn’t really help with that.
Usually, I would just read the scripts to understand how things are being used, but in this case the scripts are written in a way that makes understanding the underlying steps very difficult - which, I get, is part of the point, but I am going to keep trying to understand nevertheless :)
For example, in the commandline you wrote, it’s not clear - is the USB drive i’m trying to write expected to be connected to the Xavier NX? I would vastly prefer to write USB drives directly on the host computer, or if that’s not recommended then to at least understand why not.
Also, your suggestion of “leave everything unmodified” - the only thing I’ve modified at this point is changing NUM_SECTORS to be the actual number of sectors of my disk…
Finally, “The APP partition should automatically get expanded to the maximum upon boot” is not correct - I suspect that may be the case with some of the OEM tools which expect the user to connect keyboard and mouse and configure everything post-boot; I’m configuring a separate configuration flow which removes the need for all that. If the “initrd flash” process can’t be configured to support setting the APP partition size, why even have it as an option? I can certainly change my tools to resize the partition after its creation (it does seem to get created at the end of the disk) and resize the file system on the parition, but it sure would be easier to have it happen when the USB disk is being written initially…
Yes, the resize of the APP partition is done with some scripts during OEM config upon initial boot.
The logic is that the partition layout file for flashing external devices (flash_l4t_external.xml) is by default for 64GB, as you can see with the num_sectors=“119537664”, so because you specify the size of the APP partition to be 80GB, you also have to specify the sector size, or it will exceed the limit of 64GB. Or you just leave them both unmodified, and let the resize script do the work.