How it works...

Let's have a look at the linux-wandboard_4.1-2.0.x.bb recipe:

include linux-wandboard.inc                                                       
                                                                                 
DEPENDS += "lzop-native bc-native"                                               
                                                                                 
SRCBRANCH = "4.1-2.0.x-imx"                                                      
SRCREV = "0d698de42426a92e3ba47071f11960aeb91eb349"                              
                                                                                 
COMPATIBLE_MACHINE = "(wandboard)"    

The first interesting thing is the inclusion of linux-wandboard.inc, which we will look into later on.

Then it declares two package dependencies, lzop-native and bc-native. The native part tells us that these are used in the host system, so they are used during the Linux kernel build process. The lzop tool is used to create the CPIO compressed files needed in the initramfs system, which is a system that boots from a memory-based root filesystem, and bc was introduced to avoid a Perl kernel dependency when generating certain kernel files.

Then it sets the branch and revision, and finally it sets COMPATIBLE_MACHINE to wandboard. We will speak about machine compatibility in the Adding new packages recipe of Chapter 3, The Software Layer.

Let's now have a look at the linux-wandboard.inc include file:

SUMMARY = "Linux kernel for Wandboard"                                           
LICENSE = "GPLv2"                                                                
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"         

require recipes-kernel/linux/linux-imx.inc
# Put a local version until we have a true SRCREV to point to SCMVERSION ?= "y"
SRCBRANCH ??= "master" LOCALVERSION ?= "-${SRCBRANCH}"

# Allow override of WANDBOARD_GITHUB_MIRROR to make use of # local repository easier WANDBOARD_GITHUB_MIRROR ?= "git://github.com/wandboard-org/linux.git"

# SRC_URI for wandboard kernel SRC_URI = "${WANDBOARD_GITHUB_MIRROR};branch=${SRCBRANCH} file://defconfig "

This is actually the file we were looking for. Initially, it specifies the license for the kernel source and points to it, sets a default branch and local version kernel string, and sets up the SCR_URI variable, which is the place the source code is fetched from.

It then offers the WANDBOARD_GITHUB_MIRROR variable, which we can modify in our bbappend file.

So the logical setup would be to create a GitHub account and fork the provided wandboard-org Linux repository.

Once the fork is in place, we need to modify the WANDBOARD_GITHUB_MIRROR variable. But as we saw before, the recipe configures a specific revision and branch. We want to develop here, so we want to change this to a new development branch we have created based in the original recipe's source revision as specified in the SRCREV variable. Let's call it 4.1-2.0.x-imx-dev and set the revision to automatically fetch the newest point in the branch using the AUTOREV variable. We can then add the patch that introduces the new machine to the head of the branch.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset