[yocto] 2.6.39 kernel and poky

Karl Hiramoto karl at hiramoto.org
Fri Nov 1 08:36:00 PDT 2013


On 11/01/2013 04:21 PM, Maxwell Bottiger wrote:
> I have a custom kernel and drivers I built for an Atmel AT91SAM9x5ek 
> system on a chip, and I'd like to use them with yocto to build a 
> distribution.
>
> The original documentation, support CD, etc are all based around an 
> open embedded build from 2011, which doesn't seem to work any longer.  
> Yocto looks like a great alternative, but wants to build the 3.10 
> kernel, which I don't think supports this SoC any longer.  So, is 
> there a straight forward method of building a standard Poky root 
> filesystem, but with a custom recipe for the 2.6.39 kernel instead of 
> the stock one?


I use a 2.6.35 kernel on my own overlay.  One thing i ran into with an 
older kernel and new toolchain is the need for the 
-mno-unaligned-access  compile flag.


My example:

recipies-kernel/linux/linux-yocto-custom_2.6.35.12.bb


inherit kernel
#require recipes-kernel/linux/linux-yocto.inc

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
DEFAULT_PREFERENCE = "-1"


LINUX_VERSION = "2.6.35.12"
LINUX_VERSION_EXTENSION ?= "-custom"
KBRANCH = "master"
META = "meta"

SRC_URI = 
"git://my_url/linux-2.6.35.12.git;branch=${KBRANCH};branch=master;protocol=ssh;user=git"


SRC_URI += "file://defconfig"
SRC_URI += "file://extra-cflags-override.patch"

KERNEL_EXTRA_ARGS="LOADADDR=0x2000000  V=1 KCFLAGS=-mno-unaligned-access"


UBOOT_ENTRYPOINT="2000000"

SRCREV="master"


PV = "${LINUX_VERSION}"

PR = "r1"

S = "${WORKDIR}/git"
EXTRA_OEMAKE = "${PARALLEL_MAKE}"

# Override COMPATIBLE_MACHINE to include your machine in a bbappend
# file. Leaving it empty here ensures an early explicit build failure.
COMPATIBLE_MACHINE = "(xo1-mvs)"



kernel_do_configure() {
     # fixes extra + in /lib/modules/2.6.37+
     # $ scripts/setlocalversion . => +
     # $ make kernelversion => 2.6.37
     # $ make kernelrelease => 2.6.37+
     touch ${B}/.scmversion ${S}/.scmversion

     cp ${WORKDIR}/defconfig ${B}/.config

     if [ ! -z "${INITRAMFS_IMAGE}" ]; then
         for img in cpio.gz cpio.lzo cpio.lzma cpio.xz; do
         if [ -e 
"${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
             cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" 
initramfs.$img
         fi
         done
       fi
}






More information about the yocto mailing list