Wind River Support Network

HomeDefectsLIN6-8692
Fixed

LIN6-8692 : User Guide custom kernel steps do not work

Created: Nov 5, 2014    Updated: Dec 3, 2018
Resolved Date: Feb 12, 2015
Found In Version: 6.0.0.13
Fix Version: 6.0.0.17
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Docs

Description

Following the steps from Chapter 19 of the User Guide to build a custom kernel does not work. There are several issues.

Steps to Reproduce

The steps are as described in the WR Linux 6 User Guide:

Step 1:
$ echo 'BBLAYERS += "${WRL_TOP_BUILD_DIR}wr-kernel/wr-kernel-dev" ' \
>> projectDir/bitbake_build/conf/bblayers.conf

This is incorrect, the layer is kernel-dev, not wr-kernel-dev, and other parts of the path are missing. Building with this (at step 7) would give the following error:

ERROR: Unable to parse /usr/work/intel-x86-64/glibc_std-standard-60p13-custKernwr-kernel/wr-kernel-dev/conf/layer.conf: file /usr/work/intel-x86-64/glibc_std-standard-60p13-custKernwr-kernel/wr-kernel-dev/conf/layer.conf not found

The correct step should be:

$ echo 'BBLAYERS += "${WRL_TOP_BUILD_DIR}/layers/wr-kernel/kernel-dev" ' \
>> projectDir/bitbake_build/conf/bblayers.conf

[Actually, if creating a new project it is easier to use --with-layer=wr-kernel/kernel-dev]

Step 2:
$ cd layers/local/
$ mkdir -p recipes-kernel/linux
$ cd recipes-kernel/linux/
$  echo 'FILESEXTRAPATHS := "${THISDIR}/${PN}"' >> linux-windriver-custom.bbappend

Step 3:
$ echo 'SRCREV = "5c68732e7504d2e3745c272979c2eeddd7661e5a"' >> linux-windriver-custom.bbappend

[It would be useful to show how to use a local kernel git repository here and also how to get the hash for a specific version]

Step 4:
$ echo 'COMPATIBLE_MACHINE = "${MACHINE}"' >> linux-windriver-custom.bbappend

Step 5:
$ mkdir -p linux-windriver-custom          
$  cp /path/to/my/custom_defconfig linux-windriver-custom/defconfig
$  echo 'SRC_URI += " file://defconfig"' >> linux-windriver-custom.bbappend

Step 6:
$ cd ../../../..
$ vi local.conf
--> change PREFERRED_PROVIDER_virtual/kernel_<BSPNAME> = "linux-windriver" to PREFERRED_PROVIDER_virtual/kernel_<BSPNAME> = "linux-windriver-custom"

The final bbappend looks like this:
FILESEXTRAPATHS := "${THISDIR}/${PN}"
SRCREV = "5c68732e7504d2e3745c272979c2eeddd7661e5a"
COMPATIBLE_MACHINE = "${MACHINE}"
SRC_URI += " file://defconfig"

Step 7:
$ make -C build linux-windriver-custom

Note the kernel version being displayed by the build:

Currently 1 running tasks (626 of 655):
0: linux-windriver-custom-3.4+gitAUTOINC+5c68732e75-r1 do_fetch (pid 3142)

Whilst we requested a 3.11.1 kernel (and the hash matches this) the build thinks it is a 3.4 kernel. This can be corrected by adding the following to the bbappend (at step 3)

LINUX_VERSION = "3.11.1"

During the packaging stage we see the following errors:

ERROR: QA Issue: File '/usr/src/kernel-3.18.0-rc3-wr6.0.0.13-standard/arch/x86/vdso/vdsox32.so' from linux-windriver-custom was already stripped, this will prevent future debugging!
ERROR: QA Issue: File '/usr/src/kernel-3.18.0-rc3-wr6.0.0.13-standard/arch/x86/vdso/vdso64.so' from linux-windriver-custom was already stripped, this will prevent future debugging!

Notice the kernel version here is 3.18.0-rc3. This is the latest (head) kernel in the kernel.org git repository (at time of writing) and not the version requested. This can also be seen by looking at the kernel Makefile:

$ head build/linux-windriver-custom/linux/Makefile 
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 0
EXTRAVERSION = -rc3
NAME = Diseased Newt

The requested version wqas not checked out. To fix this the following needs to be added (again in Step 3) to the bbappend file:

SRCREV_machine = "${SRCREV}"
SRCREV_meta = "${SRCREV}"

There follow further errors and warnings due to this kernel version. It may be good to note that kernels from 3.16 onwards have different build rules so can not be built with the recipes in WRL6.

I was also unable to find the commit used in the example at all in the repository, perhaps using 3.11, which has a hash of 6e4664525b1db28f8c4e1130957f70a94c19213e would be better.

Making the suggested changes, and using v3.15, I was able to build successfully with a bbappend that looks like this:

FILESEXTRAPATHS := "${THISDIR}/${PN}"
COMPATIBLE_MACHINE = "${MACHINE}"
LINUX_VERSION = "3.15"
SRCREV = "1860e379875dfe7271c649058aeddffe5afd9d0d"
SRCREV_machine = "${SRCREV}"
SRCREV_meta = "${SRCREV}"
SRC_URI += " file://defconfig"

I was also able to build from a local git repository by adding the following:

SRC_URI = "git:///path/to/local/git/repository/linux.git;protocol=file;nocheckout=1"

Other Downloads


Live chat
Online