Building core-image-full-cmdline kernel 3.14.52 Yocto 2.1

From Estone Technology Wiki
Jump to: navigation, search

HIO-IMX6DL-BOARD YOCTO BUILD - 2.1 KROGOTH

This build depends on:

  • Uboot

-URI: https://github.com/estonetechnology/imx6qdl-linux-uboot.git

-branch: imx_v2015.04_3.14.52_1.1.0_ga

  • kernel

-URI: https://github.com/estonetechnology/imx6qdl-linux-kernel.git

-branch: imx_3.14.52_1.1.0_ga

  • Yocto - fsl-community-bsp

-URI: https://github.com/Freescale/fsl-community-bsp-platform

-branch: krogoth

  • SDK

-URI: https://www.dropbox.com/s/6hq08xfv1r8dt3j/poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh?dl=0

INSTALL SDK

download SDK.

$chmod +x [/home/user_name/Downloads/]poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh
$sh poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh

follow instruction and install SDK at /opt -SDK installs at /opt by default - When prompted to install press 'Enter'

-Change directory to your home directory

$sudo mkdir <project_name>
$cd <project_name>

-Once in this directory follow instructions below to start compiling U-BOOT, KERNEL & ROOTFS

COMPILE U-BOOT

- In <project_name> directory
$git clone -b imx_v2015.04_3.14.52_1.1.0_ga https://github.com/estonetechnology/imx6qdl-linux-uboot.git $cd imx6qdl-linux-uboot/ $source /opt/poky/2.1.3/environment-setup-cortexa9hf-neon-poky-linux-gnueabi $export ARCH=arm $export CROSS_COMPILE=arm-poky-linux-gnueabi- $make hio-imx6dl-board_spl_defconfig $make $mv -f u-boot.img SPL <project_name> directory $cd ..
  • File Generated:

-SPL
-u-boot.img

COMPILE KERNEL

$git clone -b imx_3.14.52_1.1.0_ga https://github.com/estonetechnology/imx6qdl-linux-kernel.git
$cd imx6qdl-linux-kernel/
$source /opt/poky/2.1.3/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
$export ARCH=arm
$export CROSS_COMPILE=arm-poky-linux-gnueabi-
$make hio-imx6dl-board_defconfig 
$make 
$make hio-imx6dl-board.dtb
$cd /arch/arm/boot/
$mv -f zImage /project/name/directory
$cd /dts
$mv -f hio-imx6dl-board.dtb
-change directory back to project_name directory
  • File Generated

-zImage File Location: imx6qdl-linux-kernel/arch/arm/boot/zImage
-hio-imx6dl-board.dtb File location: imx6qdl-linux-kernel/arch/arm/boot/dts/hio-imx6dl-board.dtb

COMPILE ROOTFS

INSTALL REPO

$mkdir ~/bin
$curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$chmod a+x ~/bin/repo

BITBAKE IMAGE

$PATH=${PATH}:~/bin
$mkdir fsl-community-bsp
$cd fsl-community-bsp/
$repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
Restart Terminal
$cd fsl-community-bsp/
$repo sync
$cd sources/
$git clone -b krogoth https://github.com/chausieu/meta-hio.git
$cd ..
$. ./setup-environment build
$git clone https://github.com/estonetechnology/hio-imx6dl-board-conf.git
$mv hio-imx6dl-board-conf/local.conf hio-imx6dl-board-conf/bblayers.conf conf/
  • Compiling image:
$bitbake core-image-full-cmdline
  • Get tar.bz2 image
$cd fsl-community-bsp/build/tmp/deploy/images/hio-imx6dl-board/
$mv core-image-full-cmdline-hio-imx6dl-board.tar.bz2 [your/project/directory]
  • File Generated :

-rootfs : fsl-community-bsp/build/tmp/deploy/images/hio-imx6dl-board/core-image-full-cmdline-hio-imx6dl-board.tar.bz2

HOW TO CREATE PARTITION

Insert SD Card into computer

$lsblk - to get SD Card device name i.e.: /dev/sdx

DELETE EXISITING PARTITION

$ sudo fdisk /dev/sdx
p	display note of the start sector
d	delete
1	first partition
d	delete
2	second partition
p	display
w	write

CREATE PARTITION

$ sudo fdisk /dev/sdx
p	display note of the start sector
n	create partition
p	primary selection
1	first partition	
first sector 	default 	
last sector	+50M
n	create partition
p	primary selection
2	second partition
first sector 	default 	
last sector	default
p	display
w	write

FORMAT PARTITION

$sudo mkfs.vfat /dev/sdx1
$sudo mkfs.ext4 /dev/sdx2

HOW TO FLASH IMAGE

FLASH IMAGE INTO SD CARD

Note: Files required (u-boot.img, imx6dl-hio.dtb, zImage, rootfs.tar.bz2, SPL)

Insert SD Card into computer

$lsblk - to Get SD Card device name i.e: /dev/sdx
$sudo mount /dev/sdx1 /mnt
$cd <project_files_directory>
$cp imx6dl-hio.dtb zImage u-boot.img /mnt
$sudo umount /dev/sdx1
$sudo mount /dev/sdx2 /mnt
$cd /mnt
$sudo tar -xvf <project_files_directory>/rootfs.tar.bz2
$sudo sync
$cd <project_files_directory>
$sudo umount /dev/sdx2
$sudo dd if=<project_files_directory>/SPL of=/dev/sdx bs=1k seek=1
$sync

Select 2 to boot up from SD CARD

FLASH IMAGE TO SD CARD (uImage, u-boot.imx)

FLASH IMAGE INTO EMMC

COPY krogoth/ to SD Card second partition Find eMMC device name i.e: /dev/mmcblk2 repeat the same steps as in SD Card

Select 1 to boot up from eMMC