As I mentioned in my previous post the capabilities in Intel provided SD-based Linux image is somehow limited. Fortunately the image is built using Yocto Project embedded Linux build system and Intel provides all files necessary to rebuild the Linux image. Here I will describe how to do that. Prerequisites
Basic Steps to Rebuild The Image
Building Linux Standard Base (LSB) ImageIn my case I wanted to get an LSB (Linux Standard Base) compatible image, with development tools installed on it, and USB audio support. I choose to use Poky core-image-lsb-sdk image profile as it includes all the stuff I needed. (Poky is a Yocto project reference distribution.) The instructions below assume that you already done steps 1 - 7 above, and you are in meta-clanton_v0.7.5/yocto_build/ directory. Edit conf/local.conf. We will want to use to use eglibc instead of uClibc (LSB requires eglibc/glibc). Set DISTRO to clanton-full: DISTRO ?= "clanton-full" You might also want to tweak BB_NUMBER_THREADS and PARALLEL_MAKE variables. Increase numbers if you have a computer with many cores or processors to speed up compilation process. I would recommend having 2-3 threads per core. The default configuration is OK for a dual or quad core processor system. Comment out uClibc patch for v4l2appsEdit ../meta-clanton-distro/recipes-multimedia/v4l2apps/v4l-utils_0.8.8.bbappend, prepend each line with a hash (#) sign: #FILESEXTRAPATHS_prepend := "${THISDIR}/files:" #SRC_URI += "file://uclibc-enable.patch" #DEPENDS += "libiconv" Create recipe for the imageCopy ../meta-clanton-distro/recipes-core/images/image-full.bb file to ../meta-clanton-distro/recipes-core/images/image-sdk.bb: cp ../meta-clanton-distro/recipes-core/images/image-full.bb to ../meta-clanton-distro/recipes-core/images/image-sdk.bb Edit ../meta-clanton-distro/recipes-core/images/image-sdk.bb file. Append packagegroup-core-basic packagegroup-core-lsb kernel-dev to IMAGE_INSTALL:
Append tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks to IMAGE_FEATURES: IMAGE_FEATURES += "package-management tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks" You might also want to increase root file system size from the 300 MB default to 3 GB or so. If configured as described here image will use about 1.5GB so with 3 GB you'll have plenty of space for other things. IMAGE_ROOTFS_SIZE = "3072000" Other ChangesI made a couple more tweaks to the image. First is an update to Galileo kernel patch to fix an issue with CY8C9540A I/O expander. By default intel_cln_gip module configures Intel Quark to use I2C fast mode, and CY8C9540A doesn't want to work with that mode. So the change is to make standard mode default. Find +static unsigned int i2c_std_mode; line in ../meta-clanton-bsp/recipes-kernel/linux/files/clanton.patch file and assign 1 to that variable (add = 1 before semicolon): +static unsigned int i2c_std_mode = 1; Another patch is to allow configurable file system image file name. So that I can have multiple file system images on one SD card, and switch between them easily using GRUB menu. The patch is attached to this blog (rootimage.patch). Copy it to ../meta-clanton-distro/recipes-core/initrdscripts/files/ directory and add SRC_URI += "file://rootimage.patch;patchdir=${WORKDIR}" line to ../meta-clanton-distro/recipes-core/initrdscripts/initramfs-live-boot_1.0.bbappend file: FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://name.patch;patchdir=${WORKDIR}" SRC_URI += "file://rootimage.patch;patchdir=${WORKDIR}" Once this patch is applied you can use rootimage=<filename>.ext3 option in the kernel command line in grub.conf to specify the root file system image file name. For example: title Clanton SDK root (hd0,0) kernel /bzImage--3.8-r0-clanton-20131027083753.bin root=/dev/ram0 console=ttyS1,115200n8 earlycon=uart8250,mmio32,0x8010f000,115200n8 reboot=efi,warm apic=debug rw LABEL=boot debugshell=5 rootimage=image-sdk-clanton-20131027083753.rootfs.ext3 initrd /core-image-minimal-initramfs-clanton-20131027083753.rootfs.cpio.gz Reconfigure kernel, enable whatever features you likebitbake linux-yocto-clanton -c menuconfig bitbake image-sdk For information more information on available image profiles, see the "Images" chapter in the Yocto Project Reference Manual. Install the imageFollow steps 9 - 11 above to install the image on the SD card. Files and patchesFor your convenience I attached a tarball which includes files with all the modifications described above and my kernel configuration with USB audio enabled. You can simply unpack it in to your build directory (one with meta-clanton_v0.7.5/ directory). |
Home > Sergey's Blog >