Cannot start Jetson TX2 after rebuild the kernel

Hi folks,

I have Ubuntu 16.04 on a Jetson TX2 device.
I’ve followed this tutorial to build Jetson TX kernel to install docker on my TX2 device:


After finished the described steps in the link, I tried to restart my device, it happened that the device cannot start up :(

  • Screen is black
  • No kernel options is showed.
  • Ping is not reachable.

So, does anyone have experinences about it?
Are there any solutions to roll back the device state?
Finnally, how can I restore to factory state or how can I re-install OS?
I’m looking for your answer.
Thanks in advance.

I haven’t used those scripts, I’m not sure what they do. I did look at the sources it retrieves:

wget http://developer.download.nvidia.com/embedded/L4T/r27_Release_v1.0/BSP/r27.1.0_sources.tbz2

This is an R27.1 kernel. If you used it with an R28.1 system it won’t work…the R27.1 kernel is a 3.x series, the R28.1 kernel is a 4.x series…they’re so different there isn’t a real possibility that they would be interchangeable.

You could clone, mount the clone on loopback, put the original kernel back in place, and then restore using the clone. It’s a long process, but you wouldn’t lose anything. Otherwise, if you overwrote the original kernel and didn’t use serial console to select an alternate boot entry, you will need to flash from scratch. A serial console allows you to select among multiple boot entries, and you wouldn’t need to overwrite the original…you’d simply choose at boot time which to try.

Hi linuxdev, thanks for your response.
I’m newbie on this field. Could you please explain me more clearly about mounting the clone on loopback. How would I do that? I’m not care about data on the device, I just want to restore it as factory state with the OS.
Thanks!

Factory state would imply flashing to R27.0.1, but the earliest published update is R27.1 (this was more or less just purely a bug fix release).

Every mountable partition has a file system on it. The software designed to mount this has a driver for treating a block device as a certain filesystem type…in this case ext4. Loopback allows a file to be treated as if it is a block device…the file looks like a hard drive partition when loopback covers it. Anything you can do with for example hard drive partition “/dev/sda1” (assuming it is ext4) you can do with “/dev/loop0” (assuming loop0 covers your file).

Normally you would mount a partition something like this (a contrived example, I’m assuming sdb1):

sudo mount /dev/sda1 /mnt
ls /mnt
sudo umount /mnt

The “-o” option to mount says to use options during the mount. This will cause a loop device to cover a file such that the file is mounted as if it were a hard disk:

sudo mount -o loop /where/ever/it/is/Linux_for_Tegra/clone.img /mnt
ls /mnt
sudo umount /mnt

Do beware that during a clone you will probably get a compressed/sparse version named with “.img", whereas you need the raw/uncompressed version, named with ".img.raw”. If you flash the flash software won’t care if you place “bootloader/system.img” with a raw or a sparse file, it’ll just “do the right thing”. Raw files are slower.

Some commands automatically cover a file with the loopback device. “mount -o loop” is one of those commands. You can manually add or remove loop device coverage with losetup, but beware that loop devices are dynamic and are generated as needed…and only root can generate them. Non-root can often use these devices.

If non-root runs “losetup --find” it will show the name of the first unused loop device. If the device does not exist, then it will not be created. If you run “losetup --find” as root (using sudo), then not only will this tell you the name of the first unused loop device, it will also create this device. If this command replied “/dev/loop0”, and if loop0 did not previously exist, the sudo version will actually create the file.

If you have an unused loop device you can also manually manipulate what the loop device is attached to, and then name the loop device as if it were a hard drive. “man losetup” explains this, but it can be easier to just google for examples. The one you might want to be aware of is how to detach a loop device from a file (which requires the loop device to not be mounted), e.g., if the device is loop0:

sudo losetup -d /dev/loop0

What you want is to find the system.img.raw (or whatever .raw file it is from your clone), and then “sudo mount -o loop /the/file/system.img.raw /mnt”. Then you can cd to “/mnt” and edit or copy however you desire. Then umount as it it were a spare disk.

FYI, if you were in a production environment you might consider clone a full backup. You can then rsync from the Jetson to update a clone on loopback if you’ve done something like update packages or customize something.