linux-imx: how to apply my own defconfig ?

cancel
Showing results for 
Search instead for 
Did you mean: 

linux-imx: how to apply my own defconfig ?

2,633 Views
Contributor IV

Hello,

I'm working on iMX6ULL and using linux-imx kernel on warrior branch.

I'm unable to apply my own defconfig to this, I have my own layer with bbappend file and defconfig, added to SRC_URI, but no result :-(

My final goal is to look at kernel config fragments too, I know I need linux-yocto.inc but it will be the next step !

If anyone has information or face the same issue... you'"re welcome !

Regards,

Joel

Labels (2)
0 Kudos
9 Replies

162 Views
Contributor IV

Hi all!

Finally created my own recipe that "require recipes-kernel/linux/linux-yocto.inc":

Own defconfig and support of fragments, warrior branch, no use of Freescale BSP, just clone poky and meta-openembedded. Simple and efficient.

DESCRIPTION = "Linux Kernel for SoMLabs boards"
SECTION = "kernel"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

COMPATIBLE_MACHINE = "sls16y2_792c_512r_512n_1wb"

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

DEPENDS += "lzop-native bc-native"

SRCBRANCH = "imx_4.9.123_imx8mm_ga"
LOCALVERSION = "-imx"
SRCREV = "6a71cbc089755afd6a86c005c22a1af6eab24a70"

SRC_URI += " \
git://source.codeaurora.org/external/imx/linux-imx;protocol=git;branch=${SRCBRANCH} \
file://sls16y2_792c_512r_512n_1wb.dts \
file://defconfig \
"

LINUX_VERSION ?= "4.9.123"
PV = "${LINUX_VERSION}+git${SRCPV}"

S = "${WORKDIR}/git"

# Copy the right dts after unpack of the sources
python do_copydts () {
import shutil
src = ("%s/%s.dts" % (d.getVar('WORKDIR'), d.getVar('MACHINE')))
dst = ("%s/arch/%s/boot/dts/%s" % (d.getVar('S'), d.getVar('ARCH'), d.getVar('KERNEL_DEVICETREE').replace('dtb', 'dts')))
shutil.copy2(src, dst)
}
addtask do_copydts after do_unpack before do_patch

Joel

0 Kudos

162 Views
Senior Contributor II

Hi GUITTET JOEL,

We are able to apply defconfig with our custom meta layer by following the below steps: (One can refer this link to patch the kernel).

Copy custom_defconfig to your custom meta layer and add below lines to your .bbappend file. (.bbappend of mylayer/recipes-kernel/linux/linux-imx_<mylayer>.bbappend).

  •    FILESEXTRAPATHS_prepend :="${THISDIR}/${PN}-${PV}:"
  •    SRC_URI += "file://custom_defconfig"
  •    do_copy_defconfig_append () {
            cp ${WORKDIR}/custom_defconfig ${WORKDIR}/defconfig          
            cp ${WORKDIR}/custom_defconfig ${WORKDIR}/build/.config
       }

Note: We have used Yocto Sumo BSP.

Regards,

Radhika Somaiya.

162 Views
Contributor II

Hi Guittet,

I have had success doing something similar to Radhika, but more like implementing a configuration fragment instead of a whole new file. As far as I know, the usual method of using kernel fragments is not working for imx, because of the way that the kernel recipe is implemented. I have a bbappend file (linux-imx_%.bbappend) in my own layer in "recipes-kernel/linux" with the following in it:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://kernel_config.cfg"

SRC_URI += "file://kernel.patch"

do_configure_append() {

    cat ../*.cfg >> ${B}/.config

}

I have two files under "recipes-kernel/linux/files". One is called "kernel.patch" which contains patches to the kernel (mostly for device tree stuff) and the other is called "kernel_config.cfg" which has configurations options as below:

CONFIG_POSIX_MQUEUE=y

CONFIG_HTU21=y

CONFIG_LEDS_TRIGGER_DEFAULT_ON=y

This method should work for setting up your configuration options.

Cheers,

Shawn

0 Kudos

162 Views
Contributor IV

Hello Shawn,

Yes this is the method reported here : Changing the Kernel configuration for i.MX6 SABRE 

But when you run menuconfig, without making any change, then diffconfig, a fragment is generated which is t he sum of all fragment in the recipe. Not very convenient... I try to find a way to have the same behavior than Yocto when linux-yocto.inc is used.

Joel

0 Kudos

162 Views
Contributor IV

Anyone has an idea to achieve that ?

Thanks,

Joel

0 Kudos

162 Views
NXP TechSupport
NXP TechSupport

Which version of BSP are you using?

0 Kudos

162 Views
Contributor IV

Hello Rita,

Thanks for your quick answer.

I'm using meta-freescale (GitHub - Freescale/meta-freescale: Layer containing NXP hardware support metadata ), meta-openembedded and poky, all on the warrior branch. I have my bblayers.conf and local.conf set.

I'm not using anything else, particularly, I'm not using repo and all the fsl stuff. I'm using yocto as is, just source "poky/oe-init-build-env" and then "bitbake core-image-minimal"

I know my bbappend of linux-imx is read and parsed, it also contains a specific dts which is effectively integrated. My layer also has a higher priority than meta-freescale.

Regards,

Joel

0 Kudos

162 Views
NXP TechSupport
NXP TechSupport

Here recommend you to use the newest BSP MCIMX6ULL-EVK|i.MX6ULL Evaluation Kit | NXP you can refer to the i.MX_Yocto_Project_User's_Guide document.

0 Kudos

162 Views
Contributor IV

Hello Rita,

This does not answer the original question, the BSP does not help to apply a custom defconfig to linux-imx recipe.

I have seen a similar post here https://community.nxp.com/thread/376369  but the solution is ugly...

Joel

0 Kudos