How jetson TK1 boot system on SD CARD?

How to do Jetson TK1 boot system on SD CARD . I want to upgrade ubuntu 16.04.I backup tk1 system to SD CARD. Reboot but TK1 boot system on flash not SD CARD.
What should i do?
Thanks.

Do you have serial console set up? This makes it much easier to experiment because you can get to the U-Boot command line and select from multiple boot entries. If you have the cable settings are 115200 8N1 (either software/no flow control or CTS/RTS flow control).

This isn’t purely step by step, but is information you’ll want to know before picking actual steps…

Depending on whether you have a serial console cable and other requirements the following can be adjusted for your case…

Boot loader configuration is from “/boot/extlinux/extlinux.conf”. However, there is a catch…the disk containing “/boot” does not have to be the same partition/disk as that which contains the root file system (rootfs). Most of the time people think of flashing a Jetson as requiring the same partition with the root file system and the boot configuration…this isn’t needed and keeping boot configuration on the “/boot” of eMMC simplifies life. This leaves you with a rescue system if you have a serial console.

If you edit the “root=/dev/mmcblk0p1” to instead be “root=/dev/mmcblk1p1”, then extlinux.conf on eMMC remains as configuration and the SD card is used for root file system. The “/boot” of rootfs would be ignored (from an SD card boot you can still mount eMMC somewhere and edit extlinux.conf if you desire).

If you have a serial console then you can add multiple boot configuration choices within extlinux.conf and pick which one you want at boot time. You can add an entry for eMMC (there by default), and one for SD card…pick at boot time which one you want. Once you have tested SD card you can then make this the default entry/choice…the original entry/choice is still there. It makes a great built-in rescue system.

Assuming you have a serial cable here is what I suggest as extlinux.conf:

TIMEOUT 30
DEFAULT primary

MENU TITLE Jetson-TK1 eMMC boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46ff000 mem=2015M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 board_info=0x0177:0x0000:0x02:0x43:0x00 net.ifnames=0 root=/dev/mmcblk<b>0</b>p1 rw rootwait tegraboot=sdmmc gpt

LABEL sdcard
      MENU LABEL SD Card
      LINUX /boot/zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46ff000 mem=2015M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 board_info=0x0177:0x0000:0x02:0x43:0x00 net.ifnames=0 root=/dev/mmcblk<b>1</b>p1 rw rootwait tegraboot=sdmmc gpt

Hitting a key very early on during boot with a serial console puts you in the U-Boot command line. You could experiment with boot configuration here. Or run command “boot” to continue. A very short time later you get to a kernel selection menu…if you hit a key, and if you have two entries as illustrated above, you could enter “2” and boot to SD card…or enter “1” and boot to eMMC.

If you like the SD card boot, then you could set it to default, e.g.:

TIMEOUT 30
DEFAULT <b>sdcard</b>

MENU TITLE Jetson-TK1 eMMC boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46ff000 mem=2015M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 board_info=0x0177:0x0000:0x02:0x43:0x00 net.ifnames=0 root=/dev/mmcblk<b>0</b>p1 rw rootwait tegraboot=sdmmc gpt

LABEL sdcard
      MENU LABEL SD Card
      LINUX /boot/zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46ff000 mem=2015M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 board_info=0x0177:0x0000:0x02:0x43:0x00 net.ifnames=0 root=/dev/mmcblk<b>1</b>p1 rw rootwait tegraboot=sdmmc gpt

One way to create a file system on SD card is to clone your existing system and copy it over to SD card…things like ssh keys and network setup will be cloned along with this (if you choose to do this ask for more information because just a simple file copy may not preserve permissions and copy the correct files).

To just make a new rootfs on SD card (without “/boot”…but you don’t need “/boot” filled in if you use eMMC for boot configuration):

  1. Use any partitioning tool on your SD card...probably "gdisk" since you want GPT partitions, although old style BIOS partitions will work too. You need the first partition to be the rootfs.
  2. Format that partition as ext4 (assuming it is mmcblk1p1, but it depends on whether you use the Jetson to do formatting or the host):
    sudo mkfs.ext4 /dev/mmcblk1p1
    

    NOTE: If your host has 64-bit extensions you need to format such that they won’t be used…you can run this safely on any Linux and get what you want:

    sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
    
  3. Unpack the sample rootfs onto the SD card first partition. Assuming you can mount on "/mnt" here is an example:
    1. sudo -s
    2. mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
    3. mount /dev/mmcblk1p1 /mnt
    4. cd /mnt
    5. tar xvfj /where/ever/it/is/Tegra124_Linux_R21.6.0_armhf.tbz2
    6. cd /where/ever/it/is/Linux_for_Tegra
    7. ./apply_binaries.sh -r /mnt
    8. umount /mnt
    9. exit # exits the sudo root shell

    …and this creates your SD card (without “/boot” content…“/boot” content needed only if you flashed directly to mmcblk1p1).

Incidentally, the “apply_binaries.sh” step is what adds direct hardware access drivers. If those drivers are incompatible with some component of an alternate rootfs (instead of sample rootfs), then this is where adaptation is required.

On a system which is booted you can validate if apply_binaries.sh set up drivers:

sha1sum -c /etc/nv_tegra_release