Jetson Boot Device

From ESS-WIKI
Jump to: navigation, search

In CBoot, there is bootable menu,

[0002.262] I> Using default boot order
[0002.265] I> boot-dev-order :-
[0002.268] I> 1.sd
[0002.270] I> 2.usb
[0002.272] I> 3.nvme
[0002.274] I> 4.emmc
[0002.276] I> 5.net
[0002.277] I> Hit any key to stop autoboot:     4       3       2       1

Change the boot order, you may type

$ setvar boot-order emmc, sd, usb, net

or

$ setvar boot-order emmc

And boot the system

$ boot

For example, there are two of bootable devices - NVME SSD and EMMC If the NVME SSD was plugged-in, the system will always boot NVME SSD.

Boot to Rootfs in external storage

Make Rootfs

1.Check the external drive’s device name (e.g. NVME : /dev/nvmeXn1, U-Disk : /dev/sdX): The <search_keyword> will be NVME : nvme and U-Disk : sd

$ lsblk -d -p | grep <search_keyword> | cut -d\  -f 1

Note that there must be two spaces after the ‑d\.

2.Create a new GPT:

$ sudo parted /dev/<device> mklabel gpt

Where <device> is the device name that your host computer assigns to the external drive. For example, if the host computer assigns the NVMe drive device name nvme0n1, the command is:

$ sudo parted /dev/nvme0n1 mklabel gpt

3.Add the APP partition:

$ sudo parted /dev/<device> mkpart APP 0GB <size>

Where <size> is the size of the partition. It must be at least 16 GB. It may be larger if the external drive has enough space. For example, if <device> is nvme0n1 and the partition is to contain 16 GB, enter:

$ sudo parted /dev/nvme0n1 mkpart APP 0GB 16GB

The NVME device name of the APP partition <DPART> is then <nvmeXn1>p1.
The U-Disk device name of the APP partition <DPART> is then <sdX>1.

4.Format APP as an ext4 partition and mount it.

$ sudo mkfs.ext4 /dev/<DPART>
$ sudo mount /dev/<DPART> /mnt

You may format APP as ext2 or ext3, but ext4 is strongly recommended because it is faster, more compact, and more reliable.

5.Connect the Jetson device to a host computer and put it into recovery mode, then enter the following commands to generate the rootfs without flashing the device:

$ cd Linux_for_Tegra/
$ sudo BOOTDEV=<DPART> ./flash.sh --no-flash <board> <DPART>
$ sudo mkdir tmp_system
$ sudo mount bootloader/system.img.raw ./tmp_system
$ sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude=/proc ./tmp_system/ /mnt

Where <DPART> is the device name that the Jetson device will assign to APP.

6.Unmount the external drive and disconnect it from the host computer:

$ sudo umount /mnt
$ sudo umount ./tmp_system

7.Plug the external drive into the target device and power on.

reference : nVidia

Set up boot menu for multi-rootfs

During system boot to u-boot, it will check the file /boot/extlinux/extlinux.conf to select one of rootfs.
The following example added NVME and SD card for candidate. the default rootfs will be primary. You may choose one of option in console termianl or default if there was no any selection.
Modify the root path to the <DPART> for every external storage

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      FDT /boot/tegra194-epcr7200.dtb
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

LABEL sdcard
      MENU LABEL Boot from SD Card
      LINUX /boot/Image
      INITRD /boot/initrd
      FDT /boot/tegra194-epcr7200.dtb
      APPEND ${cbootargs} quiet root=/dev/mmcblk1p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

LABEL UIO-4040
      MENU LABEL Boot from UIO-4040
      LINUX /boot/Image
      INITRD /boot/initrd
      FDT /boot/tegra194-epcr7200.dtb
      APPEND ${cbootargs} quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

EPC-R7200 Boot rootfs from NVME.pdf