Skip to content

Commit

Permalink
Added how to clone and restore the Jetson image
Browse files Browse the repository at this point in the history
  • Loading branch information
rogergranada committed Oct 21, 2017
1 parent 247470a commit 2fb1fec
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
89 changes: 89 additions & 0 deletions docs/source/jetson/image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
============================
Cloning and Restoring Image
============================

In many cases there is a large amount of work that goes into creating a working Jetson development system. This can include such things as loading drivers, compiling source files and libraries, system configuration, and so on. During development, sometimes things can go south and leave the system in a non-working state. Wouldn't it be great if you could take a snapshot of a baseline system for just such occasions? Well, you can! This is known as "cloning" the system [1]_. In this section we describe how to save and restore the system image from a Jetson to a file in the local host. The host must be the same that contains the JetPack installer that flashed the Jetson.


Cloning the system image to localhost
--------------------------------------

In order to clone the image to the localhost, first you navigate to the proper directory on the localhost to begin the process. Open a Terminal and go to the JetPack install directory (e.g., ``/home/roger/JetPack/``). The correct folder has the following content:

.. code-block:: bash
GameWorksOpenGLSamples
JetPack-L4T-3.0-linux-x64.run
JetPack_Uninstaller
TK1
_installer
host-x64-linux-public-3.7.224-e982b7b
jetpack_docs
manifest.json
repository.json
tmp
update.lock
From this folder, navigate to the ``bootloader`` folder with:

.. code-block:: bash
$ cd TK1/Linux_for_Tegra_tk1/bootloader
When in the correct folder, turn on the Jetson board in the *Recovery Mode* by powering down the device (in case Jetson is on), connecting the micro-USB cable in the recovery port and in the USB of the local host, pressing and holding the FORCE RECOVERY button while turning the board on. In order to check if Jetson is in *Recovery Mode*, in your localhost, run:

.. code-block:: bash
$ lsusb
If the board is in *Recovery Mode*, you should see the Jetson listed as NVidia (ID 0955:7140 NVidia Corp.) in the output, as the image:

.. image:: images/jetpack_6.png
:align: center
:width: 500pt

Having the Jetson board in *Recovery Mode*, run:

.. code-block:: bash
$ sudo ./nvflash --read APP clone.img --bl ardbeg/fastboot.bin --go
When running this command, an image of the Jetson board starts to be recorded into ``clone.img`` file.


Restoring the system image to Jetson
--------------------------------------

In order to restore the image from the localhost to the Jetson, first you navigate to the proper directory on the localhost to begin the process. Open a Terminal and go to the JetPack install directory (e.g., ``/home/roger/JetPack/``). From this folder, navigate to the ``bootloader`` folder with:

.. code-block:: bash
$ cd TK1/Linux_for_Tegra_tk1/bootloader
When in the correct folder, turn on the Jetson board in the *Recovery Mode* by powering down the device (in case Jetson is on), connecting the micro-USB cable in the recovery port and in the USB of the local host, pressing and holding the FORCE RECOVERY button while turning the board on. In order to check if Jetson is in *Recovery Mode*, in your localhost, run:

.. code-block:: bash
$ lsusb
If the board is in *Recovery Mode*, you should see the Jetson listed as NVidia (ID 0955:7140 NVidia Corp.) in the output, as the image:

.. image:: images/jetpack_6.png
:align: center
:width: 500pt

Having the Jetson board in *Recovery Mode*, run:

.. code-block:: bash
$ sudo ./flash.sh -r -S 14580MiB jetson-tk1 mmcblk0p1
When running this command, the image stored in ``system.img`` in the ``bootloader`` folder will be flashed in the Jetson board. The ``-r`` flag skips building and reuse the existing ``system.img`` file. The partition size ``-S 14580MiB`` is the default that JetPack uses. When the flashing process termines, reboot the Jetson. The Jetson will be restored to the state of the original at the time of cloning.

.. NOTE:: If you already have performed a cloning before restoring the image to the Jetson, you should rename the clone image to ``system.img``. Otherwise, the image restored to the Jetson board contains the original SDK.


References
-----------

.. [1] `JetsonHacks: Clone Image Tk1 <http://www.jetsonhacks.com/2015/08/26/clone-image-nvidia-jetson-tk1/>`_
1 change: 1 addition & 0 deletions docs/source/jetson/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Summary
Setting Up the OS <setup-os>
Installing ROS <ros>
Peripheral <peripheral/index>
Cloning and Restoring Image <image>

References
-----------
Expand Down

0 comments on commit 2fb1fec

Please sign in to comment.