Here is what I have verified, along with references, when available. In a nutshell, I can cross-compile multimedia samples from any drive/partition on my TX2 with
' sudo ./flash.sh -r -k APP -G 'clone filename'.img jetson-tx2 'target partition name''
The filesystem name of the target partition being cloned must be ‘APP’, which means one must change names as needed for this method. One can also create a partition image, as long as the partition is not mounted,
or with
‘sudo dd if=‘input partition name’ of=‘output filename’’
executed on the target, meaning you must have more than one Ubuntu partition and know how to boot the TX2 to them… One must also transfer the file to the host, which is done automatically with the ‘flash.sh’ method. Only the ‘.raw’ image is used.
Keep in mind that either method requires enough free disk space to “absorb” the full size of the partition being cloned, even if only a few megabytes are actually used by files. You don’t want to run out of disk space!
The next step is to mount the partition that has been cloned. Again, there are two ways (at least) to get that done.
I have been able to detect no difference in performance between the two ways .
'sudo mount -t ext4 'clone filename' 'mount point''
or
'mount -o loop 'clone filename' 'mount point''
This ‘mount point’ is TARGET_ROOTFS . ‘exporting’ it is not working on my host, it’s a mystery I haven’t had time to pursue. Because of this, after navigating to the source directory of a sample, I type:
'
sudo make TARGET_ARCH=aarch64 BUILD_TYPE=debug/release TARGET_ROOTFS=‘image mount point’
Pick one value for BUILD_TYPE.
Additionally, I have to make a couple of changes in the Rules.mk file in the ‘jetson_multimedia_api/samples’ directory. First, make the change documented here.
then find
'CUDA_PATH :=/usr/local/cuda"
and change it to:
'CUDA_PATH :=/usr/local/cuda-10.2'
I am really baffled by this last one. Of course, ‘Rules.mk’ works just fine, as delivered, on the TX2.
One little tip - keep your ‘jetson_multimedia_api’ directories and any other sources on a local hard drive. This way, you won’t accidentally delete your work when unmounting the image file. Remember, nothing gets saved to the image file.
Thanks to DaneLLL for suggestions that led to a solution, for my ayatem.