No root account following Jetson flash

Hi Guys,

A colleague had lent my his Jetson TK1 board, but he left me with 2GB of storage, and I ran out pretty quick. I flashed the disk by getting the latest Jetpack kit (seems to have L4T 21.3, CUDA 6.5, OpenCV/GL and other goodies.)

I went through the setup GUI (while looking along at the tutorial Nvidia provides) and while the flash completed succesfully I ran into two issues:

The first was that, when trying to push samples to my device, it would not except the ethernet ip I saw when plugging the Jetson into my router and typing ifconfig. Annoyingly enough the Jetson would show up when I ran arp-scan --localnet on my host machine, so I’m not sure where the hang up is. I’m also not sure why the samples can’t go over the mini USB like the disk image did.

The second and definitely more serious issue was that I have no root account to log into after the flash. There is an account called ubuntu, password ubuntu, but when I try to run sudo anything I get the following message:

/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

This seems like a relatively common issue for Linux users, but many of the solutions I’ve found online are not targeted toward L4T. I saw this post here
https://devtalk.nvidia.com/default/topic/756239/embedded-systems/after-flashing-the-jetson-tk1/2/

but I didn’t really follow what the user did to solve the problem. I’m not really sure how this went so wrong; I just downloaded the image onto my 64 bit Ubuntu Host machine, plugged in the device via mini usb, and ran the installer. I also tried running
sudo ./flash.sh -S 14580MiB jetson-tk1 mmcblk0p1

given the script that installer provides. Again the flash seems to go off successfully, but when I log into the device I can’t do much of anything (no root account.)

Is this something a lot of people run into? What went wrong? I just need to get cuda and OpenCV installed on this thing…

This is because when it is not in recovery, the jetson’s micro usb port functions as a regular usb 2.0 port (host), and not as a device.

The other stuff… No idea.

Ubuntu does not have a root account. All root access is via the ubuntu account using sudo (or for a root shell, sudo -s is more convenient). It takes a lot of getting used to, especially if you are using ssh such that it requires the prompt for password of sudo.

As far as IP address goes, I find routers themselves are often flakey. That’s a technical term! Before thinking the DHCP is bad I would recommend just rebooting the router. If you have access to logs on the router as the DHCP is attempted, that can help too. Sometimes it is as simple as the router wanting to know allowed MAC addresses first.

What does “ls -l /usr/bin/sudo” say? It should look like this:

ubuntu@tegra-ubuntu:~$ ls -l /usr/bin/sudo
-rwsr-xr-x 1 root root 111780 Feb 10  2014 /usr/bin/sudo

But if that’s broken, then I guess something went wrong when creating the rootfs.

Thanks for the replies.

The output of ls -l /usr/bib/sudo is
-rwxrwxrwx 1 root root 111780 Feb 10 2014

I don’t know much about those flags but they look pretty liberal…

Do you know how something could go wrong when creating rootfs?

rootfs itself must be unpacked as root…without that there are issues with things only root is allowed to do. Also, the rootfs must be unpacked onto a native linux partition, as something like NTFS does not have the ability to completely support all linux file types.

So far as “root” goes, Ubuntu does not have a root user, it only has root authority via sudo, so if the host is Ubuntu, then unpacking rootfs must be via sudo and similar for the actual flash requiring sudo. Remember, Ubuntu does not have a direct root account login.

FWIW, the ODROID folks suggest you zero out the eMMC before flashing it, especially if it was written to a lot before certification and shipping. Not sure if that has anything to do with your problem, but if you are the only one on the planet with this problem then it is certainly not systemic to the install process promoted here.
http://forum.odroid.com/viewtopic.php?f=53&t=947

Besides being unpacked as root, it has to have the exact permissions and ownerships, thats why the “-p” flag is used.

Example(run as root, change filename as necessary to yours):

tar -xvf Tegra124_Linux_R21.3.0_armhf.tbz2
cd Linux_for_Tegra/rootfs
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R21.3.0_armhf.tbz2

Well it may not be enabled by default but it does exist

As for the commands to enable it, I cant post them, because Nvidia logged my ip for doing so (ugh more hassle for the evening)

Instead I will give the link that does have it http://askubuntu.com/questions/44418/how-to-enable-root-login

Keep in mind its not safe to enable the account and login via lightdm, due security hazards like having the ability to change any file in the root file system without any warning, and running a web browser as root could install a permanent virus because it can essentially do whatever it wants. But if you actually know what you are doing, you will be fine.

If you want to have a root only terminal, instead run either of these commands

sudo su
sudo -i