Kbd-2.2.0-r0 do_compile: oe_runmake failed with Raspberry Pi 4

Hello,

I am trying to compile a system image using Yocto Project with the meta-mender layer for Rasperry Pi 4.

Currently, I have cloned the following:

git clone -b dunfell git://git.yoctoproject.org/poky
git clone -b dunfell https://github.com/openembedded/meta-openembedded.git
git clone -b dunfell git://git.yoctoproject.org/meta-raspberrypi
git clone -b dunfell git://github.com/mendersoftware/meta-mender

Also, I have the following layers:

layer                 path                                      priority
==========================================================================
meta                  /home/lakshanthad/mender-cm4/layers/poky/meta  5
meta-poky             /home/lakshanthad/mender-cm4/layers/poky/meta-poky  5
meta-yocto-bsp        /home/lakshanthad/mender-cm4/layers/poky/meta-yocto-bsp  5
meta-raspberrypi      /home/lakshanthad/mender-cm4/layers/meta-raspberrypi  9
meta-oe               /home/lakshanthad/mender-cm4/layers/meta-openembedded/meta-oe  6
meta-python           /home/lakshanthad/mender-cm4/layers/meta-openembedded/meta-python  7
meta-mender-core      /home/lakshanthad/mender-cm4/layers/meta-mender/meta-mender-core  6
meta-mender-raspberrypi  /home/lakshanthad/mender-cm4/layers/meta-mender/meta-mender-raspberrypi  10

Then I have the following inside local.conf:

MENDER_ARTIFACT_NAME = "release-1"
INHERIT += "mender-full"

When I try to compile as follows:

MACHINE=raspberrypi4-64 bitbake core-image-base

It has the following error during compilation:


ERROR: kbd-2.2.0-r0 do_compile: oe_runmake failed
ERROR: kbd-2.2.0-r0 do_compile: Execution of '/home/lakshanthad/mender-cm4/build/tmp/work/aarch64-poky-linux/kbd/2.2.0-r0/temp/run.do_compile.3354411' failed with exit code 1

Here is the complete log:

Would really appreciate if someone could help.

Best Regards,
Lakshantha

I don’t think this is related to Mender, kbd is not a recipe we use. Try compiling without the Mender layers first. If the error is still there you should probably ask on the OpenEmbedded or Raspberry Pi mailing lists.

It compiles successfully without mender layer.

The error happens only when I add meta-mender-core and meta-mender-raspberrypi layers and add INHERIT += “mender-full” to local.conf

Does it succeed without Mender also if you run this?

bitbake kbd

I just removed mender layer and ran bitbake kbd. Then it does not have an error.

Here are my further findings:

  1. Included mender layer with meta-mender-core and meta-mender-raspberrypi with no change to local.conf and then ran bitbake kbd. No error.

  2. Included mender layer with meta-mender-core and meta-mender-raspberrypi. Included INHERIT += “mender-full” inside local.conf and ran bitbake kbd. Has error.

I carried on further testing and found out that if I remove mender-systemd, bitbake kbd runs successfully.

INHERIT += "mender-full"
MENDER_FEATURES_DISABLE_append = " mender-systemd"

Also, the compilation succeeds with mender-systemd disabled.

I think kbd is a dependency of systemd itself

Any possible solution for this issue?

I would report the issue upstream

https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git/

http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-core/kbd/kbd?h=dunfell

and for now maybe an option your end could be to drop in a .bbappend file into your yocto layer for the kbd recipe that overrides the make compile flag format-security back to a warning so you can move forward.

https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-CFLAGS

or if feeling adventurous create your own patch for the offending source code (and submit upstream after testing)

https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe

Thank you for your response @dellgreen .

Do you think the issue is still with kbd itself?

kbd problem arises only when mender-systemd is enabled. With mender-systemd disabled, it compiles successfully.

Without mender are you still running systemd, or are you using init as your init Daemon?

Without mender, it is using init

When I use mender-systemd, does it first install init daemon as systemd and then install mender as systemd?

I tried adding the following to local.conf, just to use systemd as init daemon without any mender layer:

DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"

And then it has the KBD error.

yes if you add mender-systemd then I would expect it to have systemd as a dependency and it will get pulled into your build. So as mentioned above you will need to report/patch/override kbd yocto recipe to move forward.

It feels like the problem is with kbd itself.

I found an old version of kbd-2.2.0.tar.xz in my Yocto project downloads directory, where I was able to successfully compile before about 2 weeks ago.

Now I replaced that file in my new project and it worked. It’s weird that the upstream has no new commits during the past few weeks.

I guess I would use a diff tool to compare the contents of both working and non-working kbd source tar archives, to see if there is any difference if both files checksums are different.

After that, had your yocto layer that contains the kbd recipe changed in the last few weeks, maybe different compiler flags?

Also do the classic yocto full clean build to ensure you don’t have a dirty build causing the issue

Hello @dellgreen ,

Thank you very much for the pointers. Doing a full clean has caused the KBD error to dissappear!

I have just figured what I have been doing wrong. Here are my findings:

Test 1:

  1. Used poky, meta-openembedded, meta-raspberrypi and compile
  2. Added systemd and compile again
  3. KBD error

Test 2:

  1. Used poky, meta-openembedded, meta-raspberrypi and compile
  2. Added systemd and compile again
  3. KBD error
  4. Clean the build and compile again
  5. No KBD error

Test 3:

  1. Used poky, meta-openembedded, meta-raspberrypi, added systemd and compile
  2. No KBD error

Ok glad you have it working now.

1 Like