In that case what you can do is:
Clone the image of the rootfs.
On the host PC, loopback mount this on the “Linux_for_Tegra/rootfs/” subdirectory.
Use the script “l4t_create_default_user.sh” to put your user in place.
Note that I don’t know if this works when there is already a default user, but probably it does work.
If you cannot use that script directly, then you can apply that script to the original “rootfs/” without the loopback mount, and then copy the updated files related to password to your image.
Flash again with the edited image rather than generating a new “bootloader/system.img”.
Can you look in your “Linux_for_Tegra/tools” directory and see if you have file “l4t_create_default_user.sh”? If you have this, then try:
Clone the Jetson in recovery mode via:
sudo ./flash.sh -r -k APP -G my_backup.img jetson-xavier-nx-devkit-emmc.conf mmcblk0p1
(I wish to emphasize your host PC will need about 50 GB of free space prior to starting and that this will run for a significant time).
The above should have produced files “my_backup.img” (a “sparse” file) and “my_backup.img.raw” (a “raw” file). The sparse file is smaller, but you cannot directly edit this. Both files would work for flash, but since you are editing, then I would delete the sparse “my_backup.img”. Then to mount over “rootfs/”:
sudo mount -o loop my_backup.img.raw ./rootfs/
At this point your original system is an overlay on top of the original “rootfs/”. Changes made to this will change the loopback mounted file and not the original “rootfs/”.
See if “l4t_create_default_user.sh” works (I am pretending your user name is “jetson”, but adjust for your case, and also assuming the password is “mypassword”):
sudo ./l4t_create_default_user.sh -u jetson -p mypassword
If this works, then “sudo umount ./rootfs” to remove the overlay on top of the original rootfs content.
Be very careful that you have enough disk space, and then copy the edited “my_backup.img.raw” to the “Linux_for_Tegra/bootloader/” directory (this file will be about 32 GB in size…big and slow):
sudo cp my_backup.img.raw ./bootloader/system.img
Flash while telling the software to reuse your existing image:
sudo ./flash.sh -r jetson-xavier-nx-devkit-emmc mmcblk0p1
Here is an important point to remember: If you are not using a dev kit carrier board, and you are instead using another carrier board from a third party, then non-rootfs content would be customized for that board. The manufacturer of the other carrier board would have its own BSP. You would use that instead of the default Jetson flash software, but the steps would otherwise be the same. The goal is to have the non-rootfs content flashed by the correct software (either devkit or third party), and use the clone which was repaired as the rootfs.
If you cannot use that l4t_create_default_user.sh script, then we can use it on the original “rootfs/” and copy the password related files, and then flash as above.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)