Home > database >  Beaglebone / Yocto / Kernel configuration
Beaglebone / Yocto / Kernel configuration

Time:02-16

I want to change Kernel configuration.

I have my own layer created and inside my layer I have a _%.bbappend file which directly targets the recipe linux-ti-staging.bb (link). This recipe builds my kernel:

ziga@host:~/yocto/$ oe-pkgdata-util lookup-recipe kernel
linux-ti-staging

The recipe is part of the official layer meta-ti (link).

My layer looks like this:

002--layers/meta--001/
├── conf
│   ├── distro
│   │   └── distro.conf
│   ├── layer.conf
│   └── machine
│       └── photovolt.conf
├── recipes-all
│   ├── application
│   │   └── application.bb
│   ├── image-003
│   │   └── image-003.bb
│   └── qtbase
│       └── qtbase_%.bbappend
├── recipes-bsp
│   └── u-boot
│       ├── u-boot-ti-staging
│       │   ├── 0001--add-fotovolt-dts-to-makefile.patch
│       │   └── photovolt.dts
│       └── u-boot-ti-staging_%.bbappend
└── recipes-kernel
    └── linux
        ├── linux-ti-staging
        │   ├── 0001--add-photovolt-dts-to-makefile.patch
        │   ├── 0002--disable-hdmi-node.patch
        │   ├── 0003--remove-conflicting-mmc-pinmuxing.patch
        │   ├── defconfig
        │   ├── fragment.cfg
        │   └── photovolt.dts
        └── linux-ti-staging_%.bbappend

I tried to follow the official Yocto reference (link) to configure my _%.bbappend file in one of the two ways described there.

1st - using configuration fragment

First, I tried to use a Linux kernel fragment. I executed:

ziga@host:~/yocto/$ bitbake -c menuconfig linux-ti-staging

made my configuration in kconfig/curses interface and saved the configuration under a default name .config. Then I created a Linux configuration fragment:

ziga@host:~/yocto/$ bitbake -c diffconfig linux-ti-staging

Fragment was created and it looks like this:

ziga@host:~/yocto/$ cat 003--builds/001--fotovolt/tmp/work/fotovolt-poky-linux-gnueabi/linux-ti-staging/5.10.65 gitAUTOINC dcc6bedb2c-r22b/fragment.cfg
CONFIG_TOUCHSCREEN_ST1232=y

I copied this fragment to my layer as can be seen from the first code snippet. Now according to the official reference I also created the linux-ti-staging_%.bbappend (is detected by bitbake-layers) with this content:

FILESEXTRAPATHS:prepend := "${THISDIR}/linux-ti-staging:"
SRC_URI  = "file://fragment.cfg"

I hoped that Yocto might treat a fragment.cfg file similar as patches, but it didn't do anything.


2nd - using an entire configuration

Secondly, I tried to use an entire Linux kernel configuration. I executed:

ziga@host:~/yocto/$ bitbake -c menuconfig linux-ti-staging

made my configuration in kconfig/curses interface and saved the configuration under a diferent name i.e. defconfig (7234 lines):

ziga@host:~/yocto/$ wc -l 003--builds/001--fotovolt/tmp/work/fotovolt-poky-linux-gnueabi/linux-ti-staging/5.10.65 gitAUTOINC dcc6bedb2c-r22b/build/.config
7234

I copied this defconfig in my layer as can be seen from the first fragment of code. I then edited my linux-ti-staging_%.bbappend acccording to the official Yocto reference manual like this:

FILESEXTRAPATHS:prepend := "${THISDIR}/linux-ti-staging:"
SRC_URI  = "file://defconfig"
KCONFIG_MODE = "alldefconfig"

But this also did not work.


I cleaned before building

In both cases I used two commands to cleanly build everything:

bitbake -c cleansstate virtual/kernel
bitbake image-003

But this does absolutely nothing to the kernel configuration. I can verify that no changes were applied by (a) logging in a running target, (b) extracting the /proc/config.gz somewhere and (c) read the obtained config file. File is identical as it was...

So, how can permanently modify the kernel configuration?


Machine

My MACHINE is defined in photovolt.conf which basically reuses machine beaglebone (link) from official layer meta-ti. It looks like this:

#@TYPE: Machine
#@NAME: Photovolt machine - Beaglebone based machine
#@DESCRIPTION: Machine configuration for my machine

require conf/machine/beaglebone.conf

KERNEL_DEVICETREE = "photovolt.dtb"
UBOOT_MACHINE = "photovolt_defconfig"

Distribution

Distribution that I use is defined in a distro.conf like this:

require conf/distro/poky.conf

DISTRO = "distro"
DISTRO_NAME = "Distro (Yocto derived GNU/Linux distribution)"
DISTRO_VERSION = "1.0.0"
DISTRO_CODENAME = "Heart I"
MAINTAINER = "Me <[email protected]>"
  
DISTRO_FEATURES:append = " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME:init_manager = "systemd"
VIRTUAL-RUNTIME:initscripts = ""
   
PREFERRED_PROVIDER:virtual/libgbm = "mesa"

Recipe looks weird

Recipe linux-ti-stagging.bb (link) looks simple at a first glance, but it does some fishy things. It first requires a setup-defconfig.inc (link) which has a task do_configure(). Here it does some copy operations where it also uses a weird defconfig file (link). Maybe this is somehow connected to my problems...

CodePudding user response:

Your directory structure should be like this

meta-something
└── recipes-kernel
    └── linux
        ├── files
        │   └── defconfig
        └── linux-ti-staging.bbappend

And linux-ti-staging.bbappend

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI  = "file://defconfig"

CodePudding user response:

Is not clear if you are using YOE Distro or a clean Yocto system ?

  • Related