Deploy the kernel on your target

The linux partition contains the following elements:

A U-Boot bootscript to boot the system. The main purpose of the bootscript is to select the appropriate device tree blob depending on the detected SOM variant and carrier board. This element is provided by the bootloader Yocto recipe, not the kernel.

The linux partition is formatted with a different file system depending on the storage media:

Media

File system

microSD

FAT

eMMC

FAT

NAND flash

UBIFS

To list the contents of the linux partition on MMC media, run ls mmc x:y in the U-Boot console where x is the device index (starting at 0) and y is the partition index (starting at 1). For example, on the ConnectCore 6:

=> ls mmc 0:1
  5182488   uimage-ccimx6sbc.bin                                               
    43933   uimage-imx6dl-ccimx6sbc.dtb                                        
    44112   uimage-imx6dl-ccimx6sbc-w.dtb                                      
    44199   uimage-imx6dl-ccimx6sbc-wb.dtb                                     
    45372   uimage-imx6q-ccimx6sbc.dtb                                         
    45547   uimage-imx6q-ccimx6sbc-w.dtb                                       
    45634   uimage-imx6q-ccimx6sbc-wb.dtb                                      
    45830   uimage-imx6q-ccimx6sbc-wb-ldo-bypass.dtb                           
    45634   uimage-imx6q-ccimx6sbc-id129.dtb                                   
    45642   uimage-imx6q-ccimx6sbc-id130.dtb                                   
    44271   uimage-imx6dl-ccimx6sbc-id131.dtb                                  
     2042   boot.scr                                                           
                                                                                 
12 file(s), 0 dir(s)

For FAT partitions, you can use the updatefile command to update the kernel or the device tree blobs.

To update the files from userspace, mount the linux partition:

root@ccimx6sbc:~# mkdir /mnt/linux
root@ccimx6sbc:~# mount -t vfat /dev/mmcblk0p1 /mnt/linux
root@ccimx6sbc:~# ls -l /mnt/linux
-rwxr-xr-x    1 root     root          2042 May 10  2017 boot.scr
-rwxr-xr-x    1 root     root       5182568 May 10  2017 uImage-ccimx6sbc.bin
-rwxr-xr-x    1 root     root         44295 May 10  2017 uImage-imx6dl-ccimx6sbc-id131.dtb
-rwxr-xr-x    1 root     root         44136 May 10  2017 uImage-imx6dl-ccimx6sbc-w.dtb
-rwxr-xr-x    1 root     root         44223 May 10  2017 uImage-imx6dl-ccimx6sbc-wb.dtb
-rwxr-xr-x    1 root     root         43957 May 10  2017 uImage-imx6dl-ccimx6sbc.dtb
-rwxr-xr-x    1 root     root         45658 May 10  2017 uImage-imx6q-ccimx6sbc-id129.dtb
-rwxr-xr-x    1 root     root         45666 May 10  2017 uImage-imx6q-ccimx6sbc-id130.dtb
-rwxr-xr-x    1 root     root         45571 May 10  2017 uImage-imx6q-ccimx6sbc-w.dtb
-rwxr-xr-x    1 root     root         45854 May 10  2017 uImage-imx6q-ccimx6sbc-wb-ldo-bypass.dtb
-rwxr-xr-x    1 root     root         45658 May 10  2017 uImage-imx6q-ccimx6sbc-wb.dtb
-rwxr-xr-x    1 root     root         45396 May 10  2017 uImage-imx6q-ccimx6sbc.dtb

On the ConnectCore 6, the linux partition is automatically mounted to /mnt/linux, but as a read-only filesystem. To be able to write on the partition, remount it read/write with mount -o remount,rw /dev/mmcblk0p1 /mnt/linux.

root@ccimx6ulstarter:~# mkdir /mnt/linux
root@ccimx6ulstarter:~# mount -t ubifs /dev/ubi0_0 /mnt/linux/
root@ccimx6ulstarter:~# ls /mnt/linux/ -l
-rw-rw-r-- 1 1000 1000 648 Sep 8 2016 boot.scr
-rw-rw-r-- 1 1000 1000 5939232 Sep 8 2016 zImage-ccimx6ulstarter.bin
-rw-r--r-- 1 1000 1000 29496 Sep 8 2016 zImage-imx6ul-ccimx6ulstarter-id129.dtb
-rw-r--r-- 1 1000 1000 29496 Sep 8 2016 zImage-imx6ul-ccimx6ulstarter-wb.dtb
-rw-r--r-- 1 1000 1000 28852 Sep 8 2016 zImage-imx6ul-ccimx6ulstarter.dtb

From your development machine, you can now copy the files to the target via ssh. For example, for the ConnectCore 6UL SBC Express/Pro:

scp zImage root@<cc6ul-ip>:/mnt/linux/zImage-ccimx6ulstarter.bin

When building from Yocto, all the elements are packaged together in a single file:

To update the entire linux partition, save the image file to your TFTP server and use the update command in U-Boot:

=> update linux tftp <filename>