cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ottob
Explorer
Explorer
305 Views
Registered: ‎05-26-2017

PL 2020.2 Kernel Config

Hi There !

With previous PL versions I could just add a .cfg file to linux-xlnx_%.bbappend to change the kernel configuration. With 2020 there seems to have been a few changes. Mainly what I'm seeing is that if I enable the "Kernel Autoconfig" it generates a kernel that boots, however the .cfg files are ignored. I tried copying over the items in plnx_kernel.cfg to my cfg file and then disabling the Kernel Autoconfig, but that results in a a slew of various changes to the configuration which then generates a kernel that does not boot. 

Also, although not after the first build after tinkering a little the kernel sources show up in components/yocto/workspace/sources. Which then seem to be used for the build (instead of the files in tmp/build) further adding confusion.

Is this documented somewhere ? Any ideas on what to do ?

Thanks, 

/Otto

0 Kudos
4 Replies
ottob
Explorer
Explorer
231 Views
Registered: ‎05-26-2017

I discovered something new on this. On the first build of the Kernel it correctly pulls the configuration from the product_xzy.cfg file included in the linux-xlnx_%.bbappend. Then after a while the kernel sources are placed in the components directory along with a file components/yocto/workspace/sources/linux-xlnx/oe-local-files/product_xyz.cfg. Subsequent changes to the product_xzy.cfg file thats included in the bbappend is does NOT go into effect, as it starts using the other mystery file. 

Is there a way to turn off the kernel sources getting into the components directory ? Is this documented anywhere ?

 

Thanks,

/Otto

0 Kudos
hokim
Scholar
Scholar
192 Views
Registered: ‎10-21-2015

Hi

For kernel configuration, to avoid WARNING at https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_2/ug1144-petalinux-tools-reference-guide.pdf#page=219

,which can't be ignored because it won't apply them if you have patches,

use

 

 

$ petalinux-devtool modify -O linux-xlnx
$ petalinux-devtool menuconfig linux-xlnx

 

 

instead of

 

 

$ petalinux-config -c kernel

 

 

 

This is an procedure for configuration. I assume I already have an configuration fragment

 

 

$ tree project-spec/meta-user/recipes-kernel
project-spec/meta-user/recipes-kernel
└── linux
    ├── linux-xlnx
    │   └── user1.cfg
    └── linux-xlnx_%.bbappend

$ cat project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

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

$ petalinux-devtool modify -O linux-xlnx
$ petalinux-devtool menuconfig linux-xlnx
$ petalinux-devtool finish linux-xlnx $(pwd)/project-spec/meta-user
$ rm -fr components/yocto/workspace/sources/linux-xlnx

$ tree project-spec/meta-user/recipes-kernel
project-spec/meta-user/recipes-kernel
└── linux
    ├── linux-xlnx
    │   ├── devtool-fragment.cfg
    │   └── user1.cfg
    └── linux-xlnx_%.bbappend

$ cat project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "file://user1.cfg \
            file://devtool-fragment.cfg \
            "

$ mv project-spec/meta-user/recipes-kernel/linux/linux-xlnx/devtool-fragment.cfg project-spec/meta-user/recipes-kernel/linux/linux-xlnx/user2.cfg
$ vi project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "file://user1.cfg \
            file://user2.cfg \
            "

 

 

 

ottob
Explorer
Explorer
168 Views
Registered: ‎05-26-2017

Hi Hokim !

Thank you for your insights!  Do you know in which scenario this (new) functionality is useful (vs old straight-forward way) ? Or is this just essentially a bug ?

 

Thanks and have a great weekend !

 

/Otto

0 Kudos
hokim
Scholar
Scholar
156 Views
Registered: ‎10-21-2015

Hi 

I'm not sure whether it is bug or not which originate from yocto(poky)

petalinux-devtool modify --help shows -O option like this

 

  --no-overrides, -O    Do not create branches for other override
                        configurations

 

 

When I don't use -O option, 

https://github.com/Xilinx/poky/blob/rel-v2020.2/scripts/lib/devtool/standard.py#L490-L678

generates

temporary file components/yocto/workspace/appends/linux-xlnx_2020.2.bbappend like

 

###--- _extract_source
DEVTOOL_TEMPDIR = "/home/hokim/work/ultr96v2_base/petalinux/ultra96/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/5.4+gitAUTOINC+62ea514294-r0/devtooltmp-9peljncm"
DEVTOOL_DEVBRANCH = "devtool"
DEVTOOL_EXTRA_OVERRIDES = "minized-zynq7:pn-device-tree:pn-arm-trusted-firmware:zybo-linux-bd-zynq7"
inherit devtool-source
###--- _extract_source

 

Then,

by https://github.com/Xilinx/poky/blob/rel-v2020.2/meta/classes/devtool-source.bbclass#L168-L229

, patch files is applied.

DEVTOOL_EXTRA_OVERRIDES variable prevents correct patching

When using -O option, DEVTOOL_EXTRA_OVERRIDES variable disappears and patch is working correctly

Speaking more exactly, if DEVTOOL_EXTRA_OVERRIDES exists, the following lines throw away correct patch by do_patch

https://github.com/Xilinx/poky/blob/rel-v2020.2/meta/classes/devtool-source.bbclass#L211
https://github.com/Xilinx/poky/blob/rel-v2020.2/meta/classes/devtool-source.bbclass#L218-L226