This guide shows a step-by-step on how to build Yocto image using Intel BSP guide.
Detail documentation PDF can be found here
Pre-requisites
Before you start, make sure that you have fulfill all these requirements:
- A Linux PC host (we use Ubuntu 12.04).
- A stable network connection.
Install some dependencies:
$ sudo apt-get install build-essential git diffstat texinfo gawk chrpath file git-core coreutils unziplibsdl1.2-dev desktop-file-utils autoconf automake libtools p7zip-full
1. Get Quark BSP (1.0.1) package
Download an official Quark BSP (1.0.1) package from Intel page:
[http://downloadmirror.intel.com/23197/eng/Board_Support_Package_Sources_for_Intel_Quark_v1.0.1.7z]
2. Prepare BSP Patches
Download BSP Patches and Build Instruction package: [http://downloadmirror.intel.com/24355/eng/BSP-Patches-and-Build_Instructions.1.0.4.tar.bz2]
Untar the package:
$ tar -xvjf BSP-Patches-and-Build_Instructions.1.0.4.tar.bz2
3. Prepare meta-clanton
Unpack BSP package:
$ 7z x Board_Support_Package_*.7z
Unpack meta-clanton
$ tar xzvf meta-clanton_v1.0.1.tar.gz
4. Run setup.sh
Go into meta-clanton directory and run setup:
$ cd meta-clanton_v1.0.1/
$ ./setup.sh
5. Apply Patches
Apply some patches in recipes. Just copy-paste the commands into terminal and execute.
5.1 x264 Patch
$ sed -i 's|1cffe9f406cc54f4759fc9eeb85598fb8cae66c7|bfed708c5358a2b4ef65923fb0683cefa9184e6f|' meta-oe/meta-oe/recipes-multimedia/x264/x264_git.bbx264
5.2 OpenCV Patches
$ sed -i 's|OpenCV-|opencv-|' meta-oe/meta-oe/recipes-support/opencv/opencv_2.4.3.bb
$ sed -i 's|^SRC_URI =.*|SRC_URI = "https://github.com/Itseez/opencv/archive/${PV}.tar.gz \\|' meta-oe/meta-oe/recipes-support/opencv/opencv_2.4.3.bb
$ sed -i 's|c0a5af4ff9d0d540684c0bf00ef35dbe|744cbab090783905620da068c25e7f89|' meta-oe/meta-oe/recipes-support/opencv/opencv_2.4.3.bb
$ sed -i 's|f8fbe985978d4eae73e8c3b526ed40a37d4761d2029a5b035233f58146f6f59b|99786101446911cbb0c01761364c7c5eabd6a5df4f35cf88388dbec9bbd998c3|' meta-oe/meta-oe/recipes-support/opencv/opencv_2.4.3.bb
5.3 UART Patches
$ cp ../patches/uart-1.0.patch meta-clanton-bsp/recipes-kernel/linux/files/
$ echo 'SRC_URI += "file://uart-1.0.patch"' >> meta-clanton-bsp/recipes-kernel/linux/linux-yocto-clanton_3.8.bb
$ cp ../patches/uart-reverse-8.patch ../.
$ patch -p1 < ../uart-reverse-8.patch
5.4 USB Patches
$ cp ../patches/1.usb_improv_patch-1.patch meta-clanton-distro/recipes-galileo/galileo-target/files/
$ echo 'SRC_URI += "file://1.usb_improv_patch-1.patch"' >> meta-clanton-distro/recipes-galileo/galileo-target/galileo-target_0.1.bb
$ cp ../patches/GAL-118-USBDeviceResetOnSUSRES-2.patch meta-clanton-bsp/recipes-kernel/linux/files/
$ echo 'SRC_URI += "file://GAL-118-USBDeviceResetOnSUSRES-2.patch"' >> meta-clanton-bsp/recipes-kernel/linux/linux-yocto-clanton_3.8.bb
5.5 CLLoader Patches
$ cp ../patches/2.GAL-193-clloader-1.patch meta-clanton-distro/recipes-galileo/galileo-target/files/
$ echo 'SRC_URI += "file://2.GAL-193-clloader-1.patch"' >> meta-clanton-distro/recipes-galileo/galileo-target/galileo-target_0.1.bb
5.6 SPI Upgrader Patches
$ cp ../patches/3.GAL-199-start_spi_upgrade-1.patch meta-clanton-distro/recipes-galileo/galileo-target/files/
$ echo 'SRC_URI += "file://3.GAL-199-start_spi_upgrade-1.patch"' >> meta-clanton-distro/recipes-galileo/galileo-target/galileo-target_0.1.bb
5.7 OpenSSL Patches
$ mv poky/meta/recipes-connectivity/openssl/openssl-1.0.1e poky/meta/recipes-connectivity/openssl/openssl-1.0.1h
$ mv poky/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|66bf6f10f060d561929de96f9dfe5b8c|8d6d684a9430d5cc98a62a5d8fbda8cf|' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3|9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093|' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|file://openssl-fix-doc.patch||' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|file://0001-Fix-for-TLS-record-tampering-bug-CVE-2013-4353.patch||' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|file://0001-Fix-DTLS-retransmission-from-previous-session.patch||' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|file://0001-Use-version-in-SSL_METHOD-not-SSL-structure.patch||' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
$ sed -i 's|file://CVE-2014-0160.patch||' poky/meta/recipes-connectivity/openssl/openssl_1.0.1h.bb
5.8 WiFi Patch
$ echo 'IMAGE_INSTALL += "linux-firmware-iwlwifi-6000g2b-6"' >> meta-clanton-distro/recipes-core/images/image-full.bb
5.9 Sketch Download
$ cp ../patches/4.MAKER-222-Sketch_download_unstable-5.patch meta-clanton-distro/recipes-galileo/galileo-target/files/
$ echo 'SRC_URI += "file://4.MAKER-222-Sketch_download_unstable-5.patch"' >> meta-clanton-distro/recipes-galileo/galileo-target/galileo-target_0.1.bb
6. Resize Image
For this purpose of image, increase the size of image (from 300Mb into 3GB) in order to give more spaces for the image.
Open image-full.bb file in /meta-clanton_v1.0.1/meta-clanton-distro/recipe-core/images/ directory, then edit this line:
IMAGE_ROOTFS_SIZE = "3072000"
7. Build the Image
Execute this commands:
$ source poky/oe-init-build-env yocto_build/
$ bitbake image-full-galileo
*Building the image may take times to complete.
Upon successful build, you may see something shown below:
If build failed, trace the errors which may lead for re-build. Example of failed build is shown below:
8. Prepare Micro-SD Card
Go to meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/ directory and copy these items into SD card:
boot
directorybootia32.efi
bzImage-3.8.r0-clanton-*.bin
core-image-minimal-initramfs-clanton-*.cpio.gz
grub.efi
image-full-galileo-clanton-*.ext3
And finally rename these files:
bzImage-3.8.r0-clanton-*.bin
intobzImage
core-image-minimal-initramfs-clanton-*.cpio.gz
intocore-image-minimal-clanton.cpio.gz
image-full-galileo-clanton-*.ext3
intoimage-full-clanton.ext3
Put SD card into SD slot in Galileo board and boot your image.
blog comments powered by Disqus