106.23. hostapd-2.12
Wireless access point daemon
| 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), 815 of 1047 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://w1.fi/hostapd/ |
| Build time | 0.2 SBU |
| Installed size | 2.6 MiB in 6 files |
| Recipe | ports/core/network/hostapd/kpkgbuild |
About
hostapd turns a wireless card into an access point, and carries an EAP and RADIUS server for 802.1X networks. On KDOS it makes a machine the access point of a network of its own, one that stays up across reboots, with dnsmasq beside it for addresses and names. The Wi-Fi hotspot of Plasma’s network applet, through NetworkManager, is the quicker way to share a connection and needs none of this. The package installs hostapd, hostapd_cli, their manual pages and /etc/hostapd/hostapd.conf.example. /etc/init.d/46_hostapd.sh, which the base filesystem ships rather than this package, starts the daemon only once /etc/hostapd/hostapd.conf exists; setting one up is An access point with hostapd.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/network.txt:
hostapd completes the island network: dnsmasq is already here, so one wireless card serves addresses, names, the corpus and a PXE boot with no router in it. iw is its hard prerequisite, not a convenience.
Sources
hostapd-2.12.tar.gz(2.9 MiB)
sha256f43502561c28ba47ab77e18e1a973d07361c68cc8b14178e619bd5796b70eabd
upstream: https://w1.fi/releases/hostapd-2.12.tar.gz
archive copy: sources-3/network--hostapd-2.12.tar.gz
Dependencies
Depends on: pkgconf, openssl, libnl, sqlite.
Required by: no port names it.
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 hostapd'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/network/hostapd.
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/hostapd
echo 'f43502561c28ba47ab77e18e1a973d07361c68cc8b14178e619bd5796b70eabd hostapd-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/hostapd
SRC=$SRC_ROOT/hostapd-2.12
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf hostapd-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 hostapd
cat > .config <<'CFG'
CONFIG_DRIVER_NL80211=y
CONFIG_DRIVER_WIRED=y
CONFIG_LIBNL32=y
CONFIG_IPV6=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_IEEE80211BE=y
CONFIG_IEEE80211R=y
CONFIG_ACS=y
CONFIG_WPS=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_RSN_PREAUTH=y
CONFIG_WNM=y
CONFIG_MBO=y
CONFIG_OCV=y
CONFIG_PASN=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_EAP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_PWD=y
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_ERP=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_SQLITE=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CONFIG_OWE=y
CONFIG_INTERNAL_LIBTOMMATH=y
CONFIG_TLS=openssl
CONFIG_GETRANDOM=y
CONFIG_ELOOP=eloop
CONFIG_ELOOP_EPOLL=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_WPA_CLI_EDIT=y
CFG
make V=1 BINDIR=/usr/sbin
install -Dm755 hostapd $PKG/usr/sbin/hostapd
install -Dm755 hostapd_cli $PKG/usr/bin/hostapd_cli
install -Dm644 hostapd.conf $PKG/etc/hostapd/hostapd.conf.example
install -Dm644 hostapd.8 $PKG/usr/share/man/man8/hostapd.8
install -Dm644 hostapd_cli.1 $PKG/usr/share/man/man1/hostapd_cli.1
The switches, and why each is set:
CONFIG_DRIVER_NL80211=y— Drive the card through nl80211 with libnl 3 (CONFIG_LIBNL32=y);CONFIG_DRIVER_WIRED=yadds an 802.1X authenticator for wired ports.CONFIG_ACS=y— Automatic channel selection: withchannel=acs_surveyhostapd surveys the channels and picks the least busy one.CONFIG_IEEE80211AC=y— Wi-Fi 5 access point modes;CONFIG_IEEE80211AX=yandCONFIG_IEEE80211BE=yadd Wi-Fi 6 and 7, andCONFIG_IEEE80211R=yfast roaming. The other 802.11 features on the list are the same kind of switch:CONFIG_WPS=y,CONFIG_DPP=ywithCONFIG_DPP2=y(Easy Connect),CONFIG_RSN_PREAUTH=y,CONFIG_WNM=y,CONFIG_MBO=y,CONFIG_OCV=yandCONFIG_PASN=y.CONFIG_SAE=y— WPA3-Personal.CONFIG_SAE_PK=yadds SAE-PK, with which a client checks the access point’s public key, andCONFIG_OWE=yadds Opportunistic Wireless Encryption for open networks.CONFIG_FULL_DYNAMIC_VLAN=y— Let hostapd create the VLAN and bridge interfaces a per-station VLAN assignment needs, and withCONFIG_VLAN_NETLINK=ydo it through netlink instead ofioctl().CONFIG_EAP=y— The integrated EAP server, with each method its own switch (MD5, TLS, PEAP, MSCHAPv2, GTC, TTLS, PWD, FAST, TEAP, SIM, AKA, AKA’),CONFIG_ERP=yfor EAP re-authentication andCONFIG_PKCS12=yfor.p12keys.CONFIG_RADIUS_SERVER=y— Offer the EAP server to other access points over RADIUS;CONFIG_IPV6=ylets RADIUS run over IPv6. Upstream’s sample configuration leaves the server out.CONFIG_SQLITE=y— Leteap_user_fileand the EAP-SIM database be SQLite databases, through sqlite.CONFIG_TLS=openssl— Use OpenSSL for TLS and cryptography.CONFIG_INTERNAL_LIBTOMMATH=y— Selects hostapd’s own minimal LibTomMath for big-number arithmetic. The makefile reads it only when its internal crypto is chosen, so withCONFIG_TLS=opensslit has no effect.CONFIG_GETRANDOM=y— Seed hostapd’s random pool withgetrandom(2)instead of reading/dev/random; musl provides the call.CONFIG_ELOOP=eloop— hostapd’s own event loop, onepoll(CONFIG_ELOOP_EPOLL=y).CONFIG_DEBUG_SYSLOG=y— Allow-sto send the log to syslog, which is how the init script runs it, supervised in the foreground with no terminal to log to.CONFIG_WPA_CLI_EDIT=y— Line editing and history inhostapd_cli, through hostapd’s own small line editor; without ithostapd_clireads plain lines.
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/hostapd, 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 hostapd-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/hostapd, and runs the triggers its paths call for.
Contents
Installed programs: hostapd, hostapd_cli.
Installed directories: /etc/hostapd, /usr/share/licenses/hostapd.
Short descriptions
hostapd |
IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator |
hostapd_cli |
hostapd command-line interface |
Notes
build.sh writes the whole .config, so upstream’s defconfig does not apply and anything not on the list is left out. The package ships the sample configuration under the name hostapd.conf.example, never hostapd.conf, because the init script treats the presence of hostapd.conf as the administrator’s decision to run an access point.
NetworkManager must be told to leave the card alone, or it and hostapd both drive it; the administration page gives the unmanaged-devices line.