flash.sh fails if path isn't perfect

I’m not sure where to report bugs in scripts but this one took me a while to figure out.

Using Parallels on Mac, I wanted to setup the Xavier to run in PCIe endpoint mode. I made the appropriate changes and ran:

~/Desktop/Parallels Shared Folders/Home/Downloads/Linux_for_Tegra$ sudo ./flash.sh jetson-xavier mmcblk0p1

This reliably finished with:

sed: can't read /media/psf/Home/Downloads/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
Making system.img... 
formating ext4 filesystem on system.img failed.

When I moved the whole Linux_for_Tegra folder to ~/ all ran fine. I’m not sure whether it’s the fact that the path has spaces, or something else fishy with the path and how it’s mounted.

Hi,

May I know why your rootfs is not under your Linux_for_Tegra…?

Why do you flash in “~/Desktop/Parallels Shared Folders/Home/Downloads/Linux_for_Tegra” and it goes to find “/media/psf/Home/Downloads/Linux_for_Tegra/rootfs/”?

I just checked different revision of jetpack. In rel-32.1, nv_boot_control.conf is indeed in rootfs. However, it is moved to “Linux_for_Tegra/bootloader/”. Thus, it looks like you mix up different rootfs and driver package together…

I didn’t actually mix anything up, as far as I know.

I downloaded the tar ball, and expended in the Downloads folder.
I edited the appropriate constant to set it up in end-point mode.
I started flash.sh ~/Desktop/Parallels Shared Folders/Home/Downloads/Linux_for_Tegra

And it contained rootfs and everything else. But at the end of the script it gets confused about the path and was not able to figure it out, hence the error message at the end.

When I moved the entire Linux_For_Tegra directory to a directory higher up the tree (~/), the whole process completed perfectly; without me changing anything other than moving the directory.

Then does “/media/psf/Home/Downloads/Linux_for_Tegra/” really exist?

So there are /media/psd/Home and ~/Desktop/Parallels Shared Folders/Home/ on your host??

We didn’t have user reported such issue before. Do you directly download the driver package and not use sdkmanager?

I downloaded it directly and did not use the SDK Manager because I’m tweaking settings - following the Endpoint Software Application note.

I’ll see whether I can replicate the behaviour tomorrow; I cannot easily remotely access the VM from here. But I think that /media/psf/Home/ and ~/Desktop/Parallels Shared Folders/Home/ effectively are the same location - the home directory of my user account on MacOS.

Hi,

Our driver package does not work with VM. Are you using VM as a Ubuntu on your host…?

wow, well, you’re right. It just didn’t work that way - although the flash appeared to be successful, it wasn’t. I’ve found the sources and I’m trying with the sdk manager.

The path will fail if there are spaces in it, or some characters not in en_US.UTF-8.

That’s what I was suggesting, but I hand’t confirmed that the spaces were the whole problem. I consider that a bug. I love software that fails in obscure ways with obscure error messages that give little clue as to what the problem is.

If I had a patent on bad error messages, I’d be rich… :P