Yocto thud missing libcrypt breaks wpa_supplicant

I am trying to upgrade from sumo to thud but I got something wrong.

After I boot the Raspberry Pi and the wpa_supplicant status always shows inactive (dead), and I found some message from /var/log/user.log

Jan  1 00:00:48 raspberrypi3 wpa_supplicant: Libgcrypt warning: missing initialization - please fix the application

Does anyone have the same problem as me?


Update:

The errors message is shown after I manual run systemctl start wpa_supplicant-nl80211@wlan0

But I cannot auto start correctly when rpi boot.

I seem to have seen this at some point, but do not actually recall what it was and how I fixed it.

I suspect that it is not a problem with libgcrypt, and you can probably check your filesystem and see that it is present.

It is just a confusing error message, I would check the wpa_supplication logs (maybe increase verbosity), and I suspect that that there is something else going wrong before this is shown.

I create a new environment to compile thud and libcrypt.so is not found. But in sumo it can be found.

And I am not sure is related to this:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=27dca7d2e955370166042c05aef1524fe1fbc70b


Update:

The errors message is shown after I manual run systemctl start wpa_supplicant-nl80211@wlan0

But I cannot auto start correctly when rpi boot.

I gave it a go on thud as well. I could not reproduce your problem unfortunately.

Might be something environment specific.

I follow this post to create a new environment but still missing libcrypt.
https://hub.mender.io/t/raspberry-pi-3-model-b-b/57/21

I use the CentOS7 to compile this project, will this break anything?

This will not install the necessary parts you need for WiFi out-of-the-box, as this is a minimalist environment (offered by Yocto Project).

I would recommend you try adding the following to your local.conf:

DISTRO_FEATURES_append = " wifi"

You can also take a look at meta-mender/meta-mender-raspberrypi-demo at master · mendersoftware/meta-mender · GitHub, which contains some bits on getting WiFi running on a Raspberry Pi

The problem is happen when I use meta-mender-raspberrypi-demo and my version copy from it are got this error.

I am not sure what is wrong. It is work correctly when I use sumo, I didn’t change anything and switch to thud branch and it break.

I just ran this from scratch using the exact instructions in the hub post. The only change I made was to add the meta-mender-raspberrypi-demo layer.

I don’t have a /var/log/user.log file. I’m not sure what would be creating that. Do you have any extra software installed?

I do see the “dead” status of the wpa_supplicant service but wpa_supplicant-nl80211@wlan0 shows as live. And as far as I know this is expected when using systemd-networkd.

root@raspberrypi3:~# systemctl status wpa_supplicant | cat
â—Ź wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
root@raspberrypi3:~# systemctl status wpa_supplicant-nl80211@wlan0 | cat
â—Ź wpa_supplicant-nl80211@wlan0.service - WPA supplicant daemon (interface- and nl80211 driver-specific version)
   Loaded: loaded (/lib/systemd/system/wpa_supplicant-nl80211@.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-30 17:02:08 UTC; 2min 36s ago
 Main PID: 294 (wpa_supplicant)
   CGroup: /system.slice/system-wpa_supplicant\x2dnl80211.slice/wpa_supplicant-nl80211@wlan0.service
           └─294 /usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf -Dnl80211 -iwlan0

Sep 30 17:03:29 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:03:37 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:03:45 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:03:53 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:01 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:09 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:16 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:24 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:32 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
Sep 30 17:04:40 raspberrypi3 wpa_supplicant[294]: wlan0: Failed to initiate sched scan
root@raspberrypi3:~# 

The /var/log/user.log will generated when use core-image-full-cmdline, but I found the problem seems not related this error message.

My wpa_supplicant-nl80211@wlan0 is dead and unable to connect the network even I just add mender-mender-raspberrypi-demo-layer with their dependencies.

Hi @mirzak,
Sorry if I’m wrongly posting in this old topic, but it’s related so I figured I wouldn’t start a new one.
I encountered similar issue, however not causing a complete wpa_supplicant fail and for newer yocto brach.

The case specification:

  • Yocto release: warrior,
  • Layers included:
    • poky: meta, meta-poky, meta-yocto-bsp
    • meta-openembedded: meta-oe, meta-python, meta-networking, meta-multimedia
    • meta-raspberrypi
    • meta-mender: meta-mender-core, meta-mender-raspberrypi
  • wpa-supplicant version: 2.7,
  • libgcyrpt files in rootfs: /usr/lib/libgcrypt.so.20 and /usr/lib/libgcrypt.so.20.2.4

When I run wpa_passphrase or wpa_supplicant (with parameters -i wlan0 - B -Dnl80211 -P /var/run/wpa_supplicant.wlan0.pid) in syslog I get following warnings:

user.warn wpa_passphrase: Libgcrypt warning: missing initialization - please fix the application
user.warn wpa_supplicant: Libgcrypt warning: missing initialization - please fix the application

This also happens when wpa_supplicant is started with the same parameters by the /etc/network/if-pre-up.d/wpa_supplicant script.

Generally the device connects to the access point, receives a network address and further communication is possible (e.g. access to the Internet)
Running wpa without running in the background and with increased logging - I did not notice any warnings in wpa output.
Do you know what could be causing this warning to be generated? Could it cause a potential risk for communications security?

Thank you.

I have seen this issue for a long time now on my projects, while not observing any side affects by it. I have used wpa_supplicant 2.6 thru to 2.9 and the warning still exists. It very much looks like the wpa_supplicant code is not initializing the libgrcrypt library as per the requirements.

https://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html

might be worth filing an issue/pull request with the project, seems a simple fix

1 Like