A Debian experience

Just wanted to share my attempt to run Debian on the TX1 board. Here it goes:

  1. I intended to use the net installer which comes as a handy initrd. For the latest release as of this post, it is Jessie and its aarch64 version can be found here:

So next step is finding a way to start the kernel with initrd. The only way I found to do this is to modify the existing method of booting, i.e. through the sysboot u-boot command (bootz failed as described here https://devtalk.nvidia.com/default/topic/915758/jetson-tx1/bootz-command-on-tegratx1-not-working/). The sysboot command is not very clearly documented, or at least I couldn’t find enough info about it, so it was by looking in u-boot source to find this configuration should actually boot:

LABEL primary
      MENU LABEL debian_net
      LINUX /boot/Image
      FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
      INITRD /boot/debian/initrd.gz
      APPEND console=tty0 console=ttyS0,115200n8

Adding this boot entry one has now a chance to select desired boot mode. Right, the downloaded initrd.gz has to be placed on the emmc (path: /boot/debian/initrd.gz).

  1. Installer menu appears, but soon enough one sees, any useful network interface is missing. An a net installer without net is wrong combination. This was the point I found eth0 has something to do with USB controller, which in turn has something to do with loading a firmware file called “tegra21x_xusb_firmware”. But in the description of how to configure the rootfs of L4T documentation, there is a script called “apply_binaries.sh” which can be applied to an existing rootfs. And why not to the initrd too :)

2.1. So the initrd is unpacked:
Steps according to http://www.thegeekstuff.com/2009/07/how-to-view-modify-and-recreate-initrd-img/

# inflate the file
gzip -dk initrd.gz

mkdir tmp2
cd tmp2/
cpio -id < ../initrd
# the expanded rootfs is in /work/tegraTX1/debian/tmp2/

# add binaries to it
sudo LDK_ROOTFS_DIR=/work/tegraTX1/debian/tmp2/ ./apply_binaries.sh

NOTE: the script adds many not needed for the moment files that make the image big, but for the purposes of illustration this suffices.

2.2. Repack the initrd

# in tmp2/
find . | cpio --create --format='newc' > ../initrd_mod
cd ../
gzip initrd_mod
# the file initrd_mod.gz is the final result
  1. Replace the initrd.gz file and start over. This operation is easy to do with exporting the contents of emmc as a usb storage while in u-boot. Command goes like this:
ums 0 mmc 0

When finished Control^C in the u-boot console.

After starting finally the eth0 appeared:

lqqqqqqqqqqqqqqqqqqqqqu [!!] Configure the network tqqqqqqqqqqqqqqqqqqqqqqk
  x                                                                         x
  x Your system has multiple network interfaces. Choose the one to use as   x
  x the primary network interface during the installation. If possible,     x
  x the first connected network interface found has been selected.          x
  x                                                                         x
  x Primary network interface:                                              x
  x                                                                         x
  x                     dummy0: Unknown interface                           x
  x                     eth0: Ethernet                                      x
  x                     ip6tnl0: Unknown interface                          x
  x                     rmnetctl: Unknown interface                         x
  x                     tunl0: Unknown interface                            x
  x                     usb0: USB net                                       x
  x                                                                         x
  x     <Go Back>                                                           x
  x                                                                         x
  1. Install as desired

Some info to add on the installation process:

  1. If installing on the emmc, you must NOT touch the partition layout if you are not asking for pain. The Nvidia supplied script ./flash.sh creates a bucketful of partitions, so you should instruct the installer to just format the APP one.

After installing Debian, the rootfs should again be exported in u-boot, and ./apply_binaries.sh executed on it. Additionally, the
/boot/extlinux/extlinux.conf should be coplied over to restore defaults.

  1. If installing on USB media (I tried on the USB3 port) the obvious problem is that USB is not present before the firmware file mentioned above is not loaded. The problem is that it is on the file system on the USB port. Funny really :)

A way to workaround this was to modify the init script on the initfs.gz created in the first post. One can be taken from here:


It loads needed modules and gives control over to the now present rootfs on /dec/sda1. Yet this is relatively slow process.

IMPORTANT: There is a hangup during Debian startup. Reading through similar problems I found this solves it:


Problem is described here: