[yocto] How to config kernel in my own meta layer?

Bruce Ashfield bruce.ashfield at gmail.com
Fri Dec 22 06:21:05 PST 2017


On Thu, Dec 21, 2017 at 11:32 AM, Fan Zhang <fzhang at sgl.com> wrote:
> Greetings,
>
> I have a recipes that requires 128MB of CMA allocation for DMA. I followed
> the instruction in
> http://www.yoctoproject.org/docs/1.6/kernel-dev/kernel-dev.html#changing-the-configuration
> and did the following:
>
> My recipes structure:
>
> meta-mylayer\recipes-my\uio-test\
>
> 1. Then in uio-test folder, I have uio-test.bb that created by recipetool
> (in general) with some modification. uio-test.bb looks like this:
>
> #------------------------------------------------------------------
>
> # Recipe created by recipetool
> # This is the basis of a recipe and may need further editing in order to be
> fully functional.
> # (Feel free to remove these comments when editing.)
>
> # Unable to find any files that looked like license statements. Check the
> accompanying
> # documentation and source headers and set LICENSE and LIC_FILES_CHKSUM
> accordingly.
> #
> # NOTE: LICENSE is being set to "CLOSED" to allow you to at least start
> building - if
> # this is not accurate with respect to the licensing of the software being
> built (it
> # will not be in most cases) you must specify the correct value before using
> this
> # recipe for anything other than initial testing/development!
> LICENSE = "CLOSED"
> LIC_FILES_CHKSUM = ""
>
> # No information for SRC_URI yet (only an external source tree was
> specified)
> PV = "2.0.2"
> SRC_URI = "file://src"
>
> # NOTE: this is a Makefile-only piece of software, so we cannot generate
> much of the
> # recipe automatically - you will need to examine the Makefile yourself and
> ensure
> # that the appropriate arguments are passed in.
>
> do_configure () {
>     # Specify any needed configure commands here
>     :
> }
>
> do_compile () {
>     # You will almost certainly need to add additional arguments here
>     cd ${WORKDIR}/src
>     oe_runmake
> }
>
> FILES_${PN} = "/www/pages /etc/lighttpd.d"
> do_install () {
>     # This is a guess; additional arguments may be required
>     cd ${WORKDIR}/src
>     oe_runmake install 'DESTDIR=${D}'
> }
>
> DEPENDS = "libgcc boost"
> RDEPENDS_${PN} = "libgcc boost-thread boost-system lighttpd
> lighttpd-module-cgi"
> #------------------------------------------------------------------
>
> 2. Also in uio-test folder, I have uio-test.bbappend file with these
> contents:
>
> #------------------------------------------------------------------
>
> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> SRC_URI += "file://uio-test.cfg"
>
> #----------------------^^^^^^^^^^^^^^^^^^^-------------------------
>
> 3. In uio-test/files folder, I have uio-test.cfg with the following
> contents:
>
>
> #------------------------------------------------------------------
>
> CONFIG_CMA_ALIGNMENT=8
> CONFIG_CMA=y
> CONFIG_CMA_AREAS=7
> CONFIG_DMA_CMA=y
> CONFIG_CMA_SIZE_MBYTES=128
> CONFIG_CMA_SIZE_SEL_MBYTES=y
> CONFIG_DMADEVICES=y
> CONFIG_DMA_ENGINE=y
> CONFIG_DMA_OF=y
> CONFIG_XILINX_DMA_ENGINES=y
> CONFIG_XILINX_DMA=y
> CONFIG_DMA_API_DEBUG=y
> CONFIG_HAS_DMA=y
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_HAVE_DMA_CONTIGUOUS=y
> CONFIG_HAVE_DMA_API_DEBUG=y
> CONFIG_HAVE_GENERIC_DMA_COHERENT=y
> CONFIG_ARM_DMA_MEM_BUFFERABLE=y
> CONFIG_ZONE_DMA_FLAG=0
> #----------------------^^^^^^^^^^^^^^^^^^^-------------------------
>
> My question: I think the cfg file is being parsed because if I change the
> folder name files to something else, bitbake will complaint about not being
> able to find uio-test.cfg. However, the final .config in built do not have
> the CMA allocated. My meta layer does have a priority higher than the
> upstream layers. What else can cause the problem here? Any suggestions?
> Thanks.

The question is ... which kernel is it ? If the kernel recipe you are
using doesn't
inherit linux-yocto, the fragments won't be applied.

And a second question, what release/branch are you using ?

On that note, I actually have a patch completed to move the core of the fragment
support to kernel.bbclass, so any kernel could use it. So if you
aren't linux-yocto
and would like to test a patch, I could send it along.

Bruce

>
> Fan Zhang
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"



More information about the yocto mailing list