Flash without manually system configuration system setup

Is there a way to flash AGX Xavier with whole Ubuntu system without manually system configuration system setup? The L4T version is R32.2.1.
For testing a customize carrier board, we need to flash AGX frequently.
It really helps if we could flash AGX the whole Ubuntu.

Thank you for any advice,

I put the script link in jetson nano FAQ. The script should work for xavier too.

https://devtalk.nvidia.com/default/topic/1064525/jetson-nano/jetson-nano-faq/

Hi WayneWWW,

Thank you for your fast support.

I got an error after run the script
“./flash.sh: line 575: ./tegrarcm_v2: 沒有此一檔案或目錄”

However, AGX was set to recovery mode successfully. (see message below)
And I had done flash agx successfully before running the script.

Did I miss any?

$ sudo ./flash.sh jetson-xavier mmcblk0p1
###############################################################################

L4T BSP Information:

R32 , REVISION: 2.1

###############################################################################
./flash.sh: line 575: ./tegrarcm_v2: 沒有此一檔案或目錄
Error: probing the target board failed.
Make sure the target board is connected through
USB port and is in recovery mode.

Linux_for_Tegra$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 006: ID 0955:7019 NVidia Corp.
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 046d:c05a Logitech, Inc. M90/M100 Optical Mouse
Bus 003 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Linux_for_Tegra$ sudo ./l4t_create_default_user.sh -u nvidia -p nvidia
[sudo] password for
Creating: Username - nvidia, Password - nvidia, Autologin - false
Adding user nvidia' to group gdm’ …
Adding user nvidia to group gdm
Done.
Adding user gdm' to group video’ …
Adding user gdm to group video
Done.

Thank you for any advice,

The “no such file or command” at line 575 implies something is missing on the host. I don’t know which file or command it thinks is missing, but if you look at line 575 of flash.sh, it should say something like this (I’m looking at R32.2, and is likely the correct line, but not guaranteed):

575         ECID=$(./${rcmcmd} ${inst_args} --uid | grep BR_CID | cut -d' ' -f2);

Just before this line you might add something similar to this to find out what the rcmcmd is and the arguments (you can remove this line after testing to see what it does):

echo "DEBUG:";
echo "ECID base command: ./${rcmcmd} ${inst_args} --uid";
echo "END DEBUG";

Then see if the command is actually there (flash.sh may have changed directories, so “./” might be the directory of flash.sh, or of “bootloader/”, so on). It seems like something is missing on the host.

Hi linuxdev,

Thank you for your prompt support.

Sorry. There is no much information after added the commands you advised.
Here is the information.

u16042@desktop:~/NV_JAX_installer_r32_2_1_test_noid/Linux_for_Tegra$ sudo ./flash.sh jetson-xavier mmcblk0p1
###############################################################################

L4T BSP Information:

R32 , REVISION: 2.1

###############################################################################
DEBUG:
ECID base command: ./tegrarcm_v2 --uid
END DEBUG
./flash.sh: line 581: ./tegrarcm_v2: 沒有此一檔案或目錄
Error: probing the target board failed.
Make sure the target board is connected through
USB port and is in recovery mode.

Thank you,

tegrarcm_v2 binary should be under Linux_for_Tegra/bootloader. Do you have it?

Hi WayneWWW,

Yes.
Below is the list.

~/NV_JAX_installer_r32_2_1_test_noid/Linux_for_Tegra$ ll bootloader/tegrarcm_v2
-rwxrwxrwx 1 root root 950920 8月 13 12:44 bootloader/tegrarcm_v2*

Thank you,

Is there a way to revise the l4t_create_default_user.sh?
My host could not flash AGX now even I re-installed a Linux_for_Tegra.
All got the same error --"./flash.sh: line 575: ./tegrarcm_v2: 沒有此一檔案或目錄"

I do need to flash my agx for debugging now.

Thank you for any advice,

Is there a way to revise the l4t_create_default_user.sh?
My host could not flash AGX now even I re-installed a Linux_for_Tegra.
All got the same error --"./flash.sh: line 575: ./tegrarcm_v2: 沒有此一檔案或目錄"

l4t_create_default only updates the rootfs. It has nothing to do with your current error.
Please check why the pushd command in flash.sh cannot enter bootloader folder.

pushd "${BL_DIR}" > /dev/null 2>&1;
ECID=$(./${rcmcmd} ${inst_args} --uid | grep BR_CID | cut -d' ' -f2);

pushd bootloader >/dev/null 2>&1 does enter bootloader folder.

Below is the message.

u16042@desktop:~/NV_JAX_installer_r32_2_1_test_noid/Linux_for_Tegra$ pushd bootloader >/dev/null 2>&1
u16042@desktop:~/NV_JAX_installer_r32_2_1_test_noid/Linux_for_Tegra/bootloader$

I do not know what problem is exactly.

Thank you for any advice,

Hi HuiW,

Is this “Linux_for_Tegra” from sdkmanager or download center?

Hi WayneWWW,

I did test both from sdkmanager or from download center .

On my host, I all got the same error now.

Thanks,

Have you reboot your host?

Did reboot and got the same error result.

Could the the installation of qemu-user-static cause the problem?

Thank you,

Are you running this from a non-standard location? Is there a space or non-English character anywhere in the file path leading up to the “Linux_for_Tegra/bootloader/” directory? Is the owner of that directory the same as the user who runs the flash.sh program?

(someone else needs to answer the qemu-user-static question, but if you are running in QEMU, then that would be important to know)

May I know how do you install qemu-user-static? From apt-get?

Actually, I also wonder if Chinese system causes this problem…

Hi WayneWWW,

Due to apt-get did not work, I followed the link below to install qemu.

https://packages.ubuntu.com/xenial/amd64/qemu-user-static/download
( I did remove deb http://security.ubuntu.com/ubuntu xenial-security main universe from source.list.
Sorry. Still got the same error result.)

By the way, my Ubuntu is Chinese version but it had worked well before setup the script.

Due to the system is my development system, it’s a “disaster” to re-install the system.
Really hope this issue could be fix.

Thank you for any advice,

( I did remove deb http://security.ubuntu.com/ubuntu xenial-security main universe from source.list.
Sorry. Still got the same error result.)

Why do you think this method can help?

Due to apt-get did not work, I followed the link below to install qemu.

Could you share the result of “sudo dpkg --print-foreign-architectures”?

I just noticed something else which may be a part of this:

-rwxrwxrwx 1 <u><i><b>root root</b></i></u> 950920 8月 13 12:44 bootloader/tegrarcm_v2*

Did you unpack the driver package manually, and did you do so with sudo or root? If so, then permissions are probably wrong.

As background, normally the driver package is unpacked as a regular user, not with sudo or root. The sample rootfs and the apply_binaries.sh steps are performed with sudo, as well as actually running the flash.sh program. If the driver package itself is unpacked with root-only permissions, then there may be odd problems showing up in unusual ways.

Similar for installing JetPack/SDK Manager. The “.deb” file is installed with root permissions, but the actual sdkm command line is not run as sudo or root…when run as a regular user you would be asked for a password. If this ever ran as root and not as a regular user, then you’ll need to delete the “~/nvidia” content and start over since there are too many permissions to fix manually.

Yes, that was also my point in #11. However, HuiW told me they were using sdkmanager.