Creating a Minimal Tar File for Nvidia Jetson Orin Nano Custom BSP
Issue Overview
Users are experiencing difficulties in creating a compact tar file from their custom BSP (Board Support Package) build folder for the Nvidia Jetson Orin Nano (8GB) SOM with a custom carrier board and NVME memory. The current method produces a large tar file (14-15GB), which is inconvenient for transferring to another PC for flashing or development purposes. Users are seeking guidance on reducing the tar file size to make it more manageable, similar to the official Jetson Archive packages (2.5-3GB).
Possible Causes
-
Inclusion of unnecessary files: The build folder may contain temporary files, logs, or other non-essential data that inflates the tar file size.
-
Redundant system images: Multiple copies or versions of system images might be present in the build folder.
-
Kernel source inclusion: The full kernel source code may be included in the tar file, significantly increasing its size.
-
Inefficient compression: The current compression method may not be optimal for the types of files present in the build folder.
Troubleshooting Steps, Solutions & Fixes
-
Exclude unnecessary files and folders:
- Remove temporary files and folders created during the flashing process.
- Exclude the kernel source code if it’s not needed for flashing.
- Use the following command to create a tar file without the kernel source:
sudo tar -zcvf Linux_for_Tegra_proto1.tar.gz --exclude "source" Linux_for_Tegra
-
Remove redundant system images:
Delete the following files to reduce the tar file size:bootloader/system.img
bootloader/system.img.raw
tools/kernel_flash/images/
-
Optimize the tar command:
Use the following command to create a more compact tar file:sudo tar -zcvf Linux_for_Tegra_minimal.tar.gz --exclude "source" --exclude "bootloader/system.img" --exclude "bootloader/system.img.raw" --exclude "tools/kernel_flash/images" Linux_for_Tegra
-
Consider using massflash:
For replicating the flashing environment on another PC, consider using the massflash tool. Refer to the instructions in:Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt
-
Separate kernel sources:
If kernel sources are needed, consider creating a separate tar file for them to keep the main BSP tar file smaller. -
Verify the results:
After implementing these changes, users reported a significant reduction in tar file size, from 14-15GB to approximately 5GB. -
Fine-tune exclusions:
If further size reduction is needed, analyze the contents of the Linux_for_Tegra folder and identify additional non-essential files or folders that can be excluded from the tar file. -
Use appropriate compression:
The-z
option in the tar command uses gzip compression. If file size is a priority over compression speed, consider using xz compression instead:sudo tar -cJvf Linux_for_Tegra_minimal.tar.xz [exclude options] Linux_for_Tegra
By following these steps, users should be able to create a more compact tar file of their custom BSP for the Nvidia Jetson Orin Nano, making it easier to transfer and use on other PCs for flashing or development purposes.