106.8. wpa_supplicant-2.12
IEEE 802.1X / WPA/WPA2/WPA3 supplicant (Wi-Fi authentication backend for NetworkManager)
| Version | 2.12, release 1 |
| Shelf | network — Host network configuration and connection management: links, Wi-Fi, DHCP, DNS forwarding, time, modems, firewall and VPN |
| Phase | 41_system (System), 647 of 1047 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://w1.fi/wpa_supplicant/ |
| Build time | 0.5 SBU |
| Installed size | 4.5 MiB in 11 files |
| Recipe | ports/core/network/wpa_supplicant/kpkgbuild |
About
wpa_supplicant authenticates a machine to a wireless network, and to a wired one that uses 802.1X: it runs the WPA/WPA2/WPA3 key handshakes and the EAP methods enterprise networks ask for. On KDOS it is the Wi-Fi back end of NetworkManager, which drives it over D-Bus; the bus starts it on first use (see How polkit and ModemManager are started for what that activation depends on). wpa_cli and wpa_passphrase are installed beside it.
Sources
wpa_supplicant-2.12.tar.gz(4.1 MiB)
sha25608e23937e16d0155e55cab2b51f51fbe10d80a1aa91c4e15442645059b737ef6
upstream: https://w1.fi/releases/wpa_supplicant-2.12.tar.gz
archive copy: sources-3/network--wpa_supplicant-2.12.tar.gz
Dependencies
Depends on: openssl, libnl, dbus, pkgconf, pcsc-lite.
Required by (1): networkmanager.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install wpa_supplicant'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/network/wpa_supplicant.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/network/wpa_supplicant
echo '08e23937e16d0155e55cab2b51f51fbe10d80a1aa91c4e15442645059b737ef6 wpa_supplicant-2.12.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/wpa_supplicant
SRC=$SRC_ROOT/wpa_supplicant-2.12
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wpa_supplicant-2.12.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
cd wpa_supplicant
cat > .config <<'EOF'
CONFIG_DRIVER_NL80211=y
CONFIG_DRIVER_WIRED=y
CONFIG_DRIVER_MACSEC_LINUX=y
CONFIG_MACSEC=y
CONFIG_LIBNL32=y
CONFIG_BACKEND=file
CONFIG_CTRL_IFACE=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_IEEE80211R=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_PSK=y
CONFIG_EAP_AKA=y
CONFIG_EAP_FAST=y
CONFIG_EAP_PWD=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_AP=y
CONFIG_P2P=y
CONFIG_HS20=y
CONFIG_INTERWORKING=y
CONFIG_TLS=openssl
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_SAE=y
CONFIG_OWE=y
CONFIG_SUITEB192=y
CONFIG_FILS=y
CONFIG_OCV=y
CONFIG_DPP=y
CONFIG_WEP=y
CONFIG_DPP2=y
CONFIG_WPS=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_IEEE80211BE=y
CONFIG_TDLS=y
CONFIG_IBSS_RSN=y
CONFIG_SAE_PK=y
CONFIG_WNM=y
CONFIG_MBO=y
CONFIG_PASN=y
CONFIG_MESH=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_PAX=y
CONFIG_EAP_EKE=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_TNC=y
CONFIG_PCSC=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ELOOP_POLL=y
EOF
make BINDIR=/usr/sbin LIBDIR=/usr/lib
install -Dm755 wpa_supplicant "$PKG/usr/sbin/wpa_supplicant"
install -Dm755 wpa_cli "$PKG/usr/sbin/wpa_cli"
install -Dm755 wpa_passphrase "$PKG/usr/sbin/wpa_passphrase"
install -Dm644 dbus/fi.w1.wpa_supplicant1.service \
"$PKG/usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service"
install -Dm644 dbus/dbus-wpa_supplicant.conf \
"$PKG/etc/dbus-1/system.d/wpa_supplicant.conf"
install -Dm644 doc/docbook/wpa_supplicant.8 doc/docbook/wpa_cli.8 \
doc/docbook/wpa_passphrase.8 doc/docbook/wpa_background.8 \
-t "$PKG/usr/share/man/man8"
install -Dm644 doc/docbook/wpa_supplicant.conf.5 -t "$PKG/usr/share/man/man5"
The switches, and why each is set:
CONFIG_DRIVER_NL80211=y— Talk to wireless drivers through the kernel’s nl80211 netlink interface, which every current Linux wireless driver serves, using libnl 3 (CONFIG_LIBNL32=y).CONFIG_DRIVER_WIRED=y— Also run 802.1X on wired Ethernet ports, and withCONFIG_DRIVER_MACSEC_LINUX=yandCONFIG_MACSEC=yset up IEEE 802.1AE MACsec through the kernel’smacsecdriver.CONFIG_BACKEND=file— Keep networks in a text configuration file (wpa_supplicant.conf). The other back ends arewinreg, the Windows registry, andnone.CONFIG_CTRL_IFACE=y— The UNIX-socket control interfacewpa_cliuses.CONFIG_CTRL_IFACE_DBUS_NEW=y— Thefi.w1.wpa_supplicant1D-Bus interface, which is how NetworkManager controls it;CONFIG_CTRL_IFACE_DBUS_INTRO=yadds introspection data to it.CONFIG_DEBUG_FILE=y— Allow-fto write the debug log to a file, and withCONFIG_DEBUG_SYSLOG=y-sto send it to syslog.CONFIG_TLS=openssl— Use OpenSSL for TLS-based EAP methods and for cryptography, upstream’s default stated outright.CONFIG_EAP_MD5=y— The EAP methods, each its own switch: MD5, MSCHAPv2, TLS, PEAP, TTLS, GTC, OTP, LEAP, SIM, PSK, AKA, AKA’, FAST, PWD, TEAP, IKEv2, SAKE, GPSK (with its SHA-256 suite), PAX, EKE and TNC, withCONFIG_IEEE8021X_EAPOL=yfor the EAPOL framing they ride on. SIM, PSK, AKA, AKA’, TEAP and EKE are off in upstream’s sample configuration.CONFIG_PCSC=y— Read the SIM or USIM over PC/SC through pcsc-lite, which EAP-SIM and EAP-AKA need;CONFIG_SMARTCARD=ylets a TLS private key live on a smart card, andCONFIG_PKCS12=yreads keys and certificates from.p12/.pfxfiles.CONFIG_SAE=y— WPA3-Personal (SAE), withCONFIG_SAE_PK=yfor SAE public keys,CONFIG_OWE=yfor Opportunistic Wireless Encryption on open networks, andCONFIG_SUITEB192=yfor WPA3-Enterprise 192-bit mode.CONFIG_WEP=y— Keep support for WEP networks. Upstream builds without it unless asked, and calls WEP insecure and due to be removed; with it off, a WEP network cannot be joined at all.CONFIG_AP=y— Let a network block run the card as an access point (mode=2);CONFIG_P2P=yadds Wi-Fi Direct,CONFIG_MESH=y802.11s mesh,CONFIG_IBSS_RSN=yencrypted ad-hoc networks, andCONFIG_TDLS=ydirect links between stations.CONFIG_IEEE80211R=y— Fast roaming between access points of one network. The other 802.11 amendments on the list are the same kind of switch:CONFIG_IEEE80211AC=y,CONFIG_IEEE80211AX=yandCONFIG_IEEE80211BE=y(Wi-Fi 5, 6 and 7 station features),CONFIG_WNM=y,CONFIG_MBO=y,CONFIG_OCV=y,CONFIG_PASN=y,CONFIG_FILS=y,CONFIG_HS20=ywithCONFIG_INTERWORKING=y(Hotspot 2.0),CONFIG_DPP=ywithCONFIG_DPP2=y(Easy Connect), andCONFIG_WPS=y(Wi-Fi Protected Setup).CONFIG_BGSCAN_SIMPLE=y— The two background-scan modules,simpleandlearn(CONFIG_BGSCAN_LEARN=y), which look for a better access point while connected.CONFIG_WPA_CLI_EDIT=y— wpa_supplicant’s own limited line editing and history inwpa_cli, in place of GNU Readline (CONFIG_). Upstream’s sample configuration notes that Readline is GPL-licensed, so the BSD license may not apply to aREADLINE wpa_clilinked with it.CONFIG_ELOOP_POLL=y— Run the event loop onpollinstead ofselect, so a descriptor numbered pastFD_SETSIZEcan still be watched. Notepoll: the D-Bus interface registers its bus socket three times, for reading, writing and exceptions, andepollrefuses the secondEPOLL_CTL_ADDof one descriptor withEEXIST. The interface is then never answered, and NetworkManager reports every Wi-Fi deviceunavailable.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/wpa_supplicant, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf wpa_supplicant-2.12-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/wpa_supplicant, and runs the triggers its paths call for.
Contents
Installed programs: wpa_cli, wpa_passphrase, wpa_supplicant.
Installed directories: /usr/share/licenses/wpa_supplicant.
Short descriptions
wpa_cli |
WPA command line client |
wpa_passphrase |
Generate a WPA PSK from an ASCII passphrase for a SSID |
wpa_supplicant |
Wi-Fi Protected Access client and IEEE 802.1X supplicant |
Notes
build.sh writes the whole .config; nothing from upstream’s defconfig applies, so a feature not on the list is not built.
make is given BINDIR=/usr/sbin because it substitutes that path into the D-Bus service file it generates, fi.w1.wpa_supplicant1.service, whose Exec= line the bus runs. Left at the default it would name /usr/local/sbin/wpa_supplicant, and activation would fail. Every file is installed by hand with install; of the files the makefile generates, the systemd units are the ones left out.