2
votes

I like to remove some unused drivers for my RPI2 + custom board. For that I am creating an own configuration via:

bitbake linux-raspberrypi -c menuconfig

and save the new kernel preset to the file defconfig.

After this I created an append file for the linux-raspberryp recipe.

So I created the file

linux-raspberrypi%.bbappend

and filled it with:

FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"

SRC_URI += "file://defconfig"

PACKAGE_ARCH = "raspberrypi2"

I put the defconfig file to:

<meta-mylayer>/recipes-kernel/linux/linux-raspberrypi/raspberrypi2/defconfig

When recompiling the kernel via:

bitbake linux-raspberrypi -c clean
bitbake linux-raspberrypi

The standard RPI2 configuration is taken.

Any idea how to overcome this problem? I am working on the "actual" pyro branch of meta-raspberrypi and yocto.

2

2 Answers

7
votes

Well, unfortunately, the easiest way is probably to patch the kernel source... Or copy your defconfig over the in kernel-tree one.

The meta-raspberrypi layer does some unfortunate things in their kernel recipes, and even though this has become better with time, they're still not really nice...

If you take a look at recipes-kernel/linux/linux-raspberrypi.inc, the following lines explains the issue:

KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"

do_kernel_configme_prepend() {
    install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
}

Thus,they're copying the in-tree defconfig to ${WORKDIR}/defconfig, thereby overwriting your own defconfig.

You in you .bbappend, you could try to add:

do_kernel_configme_prepend() {
    install -m 0644 ${WORKDIR}/defconfig ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
}

Thus, first overwriting the in-kernel-tree one with your own defconfig.

2
votes

Please take a look at how to use devtool to modify source code for the jethro: http://www.yoctoproject.org/docs/2.0/dev-manual/dev-manual.html#using-devtool-in-your-workflow

I would start by having a fork at the git repository that it is using; http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/recipes-kernel/linux/linux-raspberrypi_4.9.bb

Using devtool in Yocto; in your build directory: create a my-linux-raspberry folder;

mkdir linux-raspberry-test
devtool modify -x linux-raspberry ./my-linux-raspberry

This will put unpack the source code into my-linux-raspberry for you to modify; It also create the git repository in there;

Then, modify the code in my-linux-raspberry; To test build, run devtool build linux-raspberry; Once you are satisfied, add this git repository to your fork;

git add .
git commit -m "my-linux-raspberry"
devtool update-recipe linux-raspberry

Optional: run devtool reset linux-raspberry to remove the bbappend file;