#1. Download the BSP source:
$ mkdir fsl-community-bsp
$ cd fsl-community-bsp
$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dora
$ repo sync
It may take something like 15 minutes to get the source code.
Note (24Feb2014): Required disk space for repo is 238MB
UPDATE
Dora was just released: https://lists.yoctoproject.org/pipermail/meta-freescale/2013-October/005286.html
Dora is the new stable branch released on 2013 October.
If you wish to only update your source code, you may use only:
$ repo init -b dora
#2.
Synchronize your source code
Source code you have is one week old now. So, first step is synchronize it.
$ repo sync
Create your local branch
$ repo start <new branch name> --all
But there is a lot of other images you can create. In order to see how many, please:
$ find ../sources -name *image*
I would say, start core-image-base. It does not have X11 or gstreamer or QT, but it take 30 minutes to build at first time. And should work great for any board.
Following, the complete sequence of commands, it´s only to make sure you´re on the right folder:
(you are still in build directory)
$ bitbake core-image-base
Note (24Feb2014): Required disk space for build image is ~18GB
#3
This is what I have under fsl-community-bsp directory:
$ tree -d -L 2 -A
.../build_mx6$ tree -d -L 2 -A
#4
Images - the result of a bitbake
Example of a content after bitbake
build_mx6/tmp/deploy/images:
fsl-image-gui-imx6qsabresd-20130505174618.rootfs.ext3
Deploy
Deploy the sdcard image:
$ sudo dd if=fsl-image-gui-imx6qsabresd.sdcard of=/dev/sdX bs=1M
Or, deploy the ext3 rootfs
$ sudo dd if=fsl-image-gui-imx6qsabresd.ext3 of=/dev/sdX2 bs=1M
Or deploy only the tar.bz rootfs
$ sudo mount /dev/sdX2 /mnt/card
$ sudo tar xf imagename-imx53qsb.tar.bz2 -C /mnt/card
In order to deploy only kernel
$ sudo cp uImage-3.0.35-r32.10-imx6qsabresd-20130505174618.bin /media/Boot
In order to deploy only u-boot
$ sudo dd if=u-boot-imx6qsabresd-v2012.10-r3.imx of=/dev/sdX bs=512 seek=2
If using HDMI please, modify u-boot environment arguments:
setenv mmcargs "setenv bootargs console=${console},${baudrate} root=${mmcroot} rootwait rw video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24"
This is the how sdcards are made by meta-fsl-arm. Of course you can use your own. But double check the u-boot bootenv.
Plug your sdcard and let the board boot
To login: root
#5
How to change kernel configuration
Create the new defconfig
Copy it to meta-fsl-arm/recipes-kernel/linux/linux-imx-3.0.35/mx6 (or the right folder for your board/kernel)
$ bitbake -c cleansstate linux-imx
$ bitbake linux-imx (if you want only the kernel image)
$ bitbake fsl-image-gui (if you want to generate a complete image using the new kernel)
How to make menuconfig with yocto
$ bitbake -c menuconfig linux-imx
will generate a config file on tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r33.10/git/.config
The complete step by step to change the kernel configuration
$ bitbake -c menuconfig linux-imx
(change anything)
$ cp tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r33.10/git/.config ../sources/meta-fsl-arm/recipes-kernel/linux/linux-imx-3.0.35/mx6/defconfig
$ bitbake -c cleansstate linux-imx
$ bitbake fsl-image-gui
The uImage will be under tmp/deploy/image
In order to replace only uImage binary into one ready sdcard:
$sudo cp tmp/deploy/image/uImage-imx6-XXX.bin /media/user/Boot imx6/uImage
Kernel Mainline - kernel.org
In order to use kernel mainline instead of linux-imx. Please add the following code to your conf/local.conf
PREFERRED_PROVIDER_virtual/kernel = "linux-fslc"
Make sure the desired board is supported by kernel.org.
In order to take and build kernel mainline manually, please see https://community.freescale.com/docs/DOC-95017
Final points
It´s not a simple task, I know. Yocto is not the best tool for use to develop and customize kernel during development stage. It is easier to use an external toolchain (bitbake meta-toolchain). Once the kernel development, or customization, is done, the changes can be integrated in the Yocto so it is managed for production use.
I like to have a copy of kernel source code cloned on my machine directly from git.freescale.com, then I can re-configure it, rebuild it, apply some patches, make changes, and build it manually - any way I want it. So, I only change kernel using yocto when I know the bug and I know how to fix it, and I have the patch. (and this is the way I like to work)
Although this is how to configure (and even patch) kernel (if you want to patch kernel, follow the example in the recipes)
If you face any error, please, let me know. I tested the steps and it worked, but I´m using an Ubuntu machine, not a virtual machine (and I´m not sure how -c menuconfig will act in a virtual machine).
$ mkdir fsl-community-bsp
$ cd fsl-community-bsp
$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dora
$ repo sync
It may take something like 15 minutes to get the source code.
Note (24Feb2014): Required disk space for repo is 238MB
UPDATE
Dora was just released: https://lists.yoctoproject.org/pipermail/meta-freescale/2013-October/005286.html
Dora is the new stable branch released on 2013 October.
If you wish to only update your source code, you may use only:
$ repo init -b dora
#2.
Synchronize your source code
Source code you have is one week old now. So, first step is synchronize it.
$ repo sync
Create your local branch
$ repo start <new branch name> --all
But there is a lot of other images you can create. In order to see how many, please:
$ find ../sources -name *image*
I would say, start core-image-base. It does not have X11 or gstreamer or QT, but it take 30 minutes to build at first time. And should work great for any board.
Following, the complete sequence of commands, it´s only to make sure you´re on the right folder:
(you are still in build directory)
$ bitbake core-image-base
Note (24Feb2014): Required disk space for build image is ~18GB
#3
This is what I have under fsl-community-bsp directory:
$ tree -d -L 2 -A
.../build_mx6$ tree -d -L 2 -A
#4
Images - the result of a bitbake
Example of a content after bitbake
build_mx6/tmp/deploy/images:
fsl-image-gui-imx6qsabresd-20130505174618.rootfs.ext3
Deploy
Deploy the sdcard image:
$ sudo dd if=fsl-image-gui-imx6qsabresd.sdcard of=/dev/sdX bs=1M
Or, deploy the ext3 rootfs
$ sudo dd if=fsl-image-gui-imx6qsabresd.ext3 of=/dev/sdX2 bs=1M
Or deploy only the tar.bz rootfs
$ sudo mount /dev/sdX2 /mnt/card
$ sudo tar xf imagename-imx53qsb.tar.bz2 -C /mnt/card
In order to deploy only kernel
$ sudo cp uImage-3.0.35-r32.10-imx6qsabresd-20130505174618.bin /media/Boot
In order to deploy only u-boot
$ sudo dd if=u-boot-imx6qsabresd-v2012.10-r3.imx of=/dev/sdX bs=512 seek=2
If using HDMI please, modify u-boot environment arguments:
setenv mmcargs "setenv bootargs console=${console},${baudrate} root=${mmcroot} rootwait rw video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24"
This is the how sdcards are made by meta-fsl-arm. Of course you can use your own. But double check the u-boot bootenv.
Plug your sdcard and let the board boot
To login: root
#5
How to change kernel configuration
Create the new defconfig
Copy it to meta-fsl-arm/recipes-kernel/linux/linux-imx-3.0.35/mx6 (or the right folder for your board/kernel)
$ bitbake -c cleansstate linux-imx
$ bitbake linux-imx (if you want only the kernel image)
$ bitbake fsl-image-gui (if you want to generate a complete image using the new kernel)
How to make menuconfig with yocto
$ bitbake -c menuconfig linux-imx
will generate a config file on tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r33.10/git/.config
The complete step by step to change the kernel configuration
$ bitbake -c menuconfig linux-imx
(change anything)
$ cp tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r33.10/git/.config ../sources/meta-fsl-arm/recipes-kernel/linux/linux-imx-3.0.35/mx6/defconfig
$ bitbake -c cleansstate linux-imx
$ bitbake fsl-image-gui
The uImage will be under tmp/deploy/image
In order to replace only uImage binary into one ready sdcard:
$sudo cp tmp/deploy/image/uImage-imx6-XXX.bin /media/user/Boot imx6/uImage
Kernel Mainline - kernel.org
In order to use kernel mainline instead of linux-imx. Please add the following code to your conf/local.conf
PREFERRED_PROVIDER_virtual/kernel = "linux-fslc"
Make sure the desired board is supported by kernel.org.
In order to take and build kernel mainline manually, please see https://community.freescale.com/docs/DOC-95017
Final points
It´s not a simple task, I know. Yocto is not the best tool for use to develop and customize kernel during development stage. It is easier to use an external toolchain (bitbake meta-toolchain). Once the kernel development, or customization, is done, the changes can be integrated in the Yocto so it is managed for production use.
I like to have a copy of kernel source code cloned on my machine directly from git.freescale.com, then I can re-configure it, rebuild it, apply some patches, make changes, and build it manually - any way I want it. So, I only change kernel using yocto when I know the bug and I know how to fix it, and I have the patch. (and this is the way I like to work)
Although this is how to configure (and even patch) kernel (if you want to patch kernel, follow the example in the recipes)
If you face any error, please, let me know. I tested the steps and it worked, but I´m using an Ubuntu machine, not a virtual machine (and I´m not sure how -c menuconfig will act in a virtual machine).