Building Robert Nelson's Linux Kernel into Yocto(Daisy) for Beaglebone Black

Beaglebone / Yocto / Kernel configuration

It is obvious in setup-defconfig.inc that they handle config fragments in do_configure with this part:

# Fourth, handle config fragments specified in the recipe
# The assumption is that the config fragment will be specified with the absolute path.
# E.g. ${WORKDIR}/config1.cfg or ${S}/config2.cfg
if [ -n "${KERNEL_CONFIG_FRAGMENTS}" ]
then
for f in ${KERNEL_CONFIG_FRAGMENTS}
do
# Check if the config fragment is available
if [ ! -e "$f" ]
then
echo "Could not find kernel config fragment $f"
exit 1
fi
done
fi

# Now that all the fragments are located merge them
if [ -n "${KERNEL_CONFIG_FRAGMENTS}" -o -n "$configfrags" ]
then
( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config $configfrags ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
yes '' | oe_runmake -C ${S} O=${B} oldconfig
fi

So, here is the explanation of what it does:

  • It checks if the variable KERNEL_CONFIG_FRAGMENTS has a content
  • If yes, it checks if its content (files) exist
  • Merge all config fragments of and KERNEL_CONFIG_FRAGMENTS and configfrags into ${B}/.config which is the final configuration that will be built

configfrags just used to hold extracted fragments from other defconfig file. It does not matter for your case.

So, here what you can do in linux-ti-staging_%.bbappend:

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://fragment.cfg"
KERNEL_CONFIG_FRAGMENTS += "${WORKDIR}/fragment.cfg"

Since they are checking directly on the content of KERNEL_CONFIG_FRAGMENTS it will fail if you set it without ${WORKDIR}.

${WORKDIR} is where fragment.cfg will be unpacked.

So, based on what they are using on do_configure, the test on KERNEL_CONFIG_FRAGMENTS should pass because it will have content, and it will merge its config into the configuration file ${B}/.config.

To check that, after do_configure just check the content of ${B}/.config for your new fragment content.

ALERT
YOU NEED TO LEFT THE FIRST LINE IN THE FRAGMENT FILE AS EMPTY LINE. BECAUSE merge_config.sh WILL SKIP IT.

So, your fragment will look like the following:


CONFIG_TOUCHSCREEN_ST1232=y

If that did not work, try to add this custom function to apply your fragment.cfg into the final configuration file:

  • linux-ti-staging_%.bbappend:
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://fragment.cfg"

CUSTOM_FRAGMENTS += "fragment.cfg"

do_merge_fragment(){
for f in ${CUSTOM_FRAGMENTS}; do
if [ -f "${WORKDIR}/${f}" ]; then
${S}/scripts/kconfig/merge_config.sh -m ${B}/.config ${WORKDIR}/${f}
fi
done
}

addtask merge_fragment after do_configure before do_compile

With that you will make sure that the fragment will be applied.

Difference between BSP Provided by Poky and meta-ti for Beaglebone black

Here's a very detailed answer from over 5 years ago:
https://lists.yoctoproject.org/pipermail/yocto/2014-October/021818.html

yocto beaglebone black pru configuration

Avoid having both meta-yocto-bsp and meta-ti in your bblayers.conf!

Both of these two layers are BSP-layers that defines a beaglebone machine.

In meta-ti, the beaglebone machine is part of ti33x, however, the meta-yocto-bsp version of beaglebone doesn't know anything of ti33x (which in turn is defined in meta-ti).

Thus, you bblayers.conf mixes those two machines with an identical name. The solution for you is to remove meta-yocto-bsp, as you want eg pru-stuff from meta-ti.

How to compile linux-raspberrypi kernel in yocto?

Remove IMAGE_INSTALL_append = " linux-raspberrypi" and try adding to local.conf (or machine.conf) PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi".



Related Topics



Leave a reply



Submit