diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-05-28 12:44:37 +0200 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-05-31 22:02:42 +0200 |
commit | 97c67abab07a57840f95d04fadbd13b3c0f5b328 (patch) | |
tree | cdd484a2af71b89ff7a75c5eb808e6e18f00801d /aports/hostapd | |
parent | a6085330a18c8a257d2e185aab016c483335f86a (diff) | |
download | freebsd-wifibox-alpine-97c67abab07a57840f95d04fadbd13b3c0f5b328.zip |
Incorporate `hostapd`.
The inclusion of `hostapd` [1] brings a lot of related changes
because the build process have to extended to take the challenge.
- Convert `wpa_passthru` to a more a generic services, called
`uds_passthru` to deal with the control socket forwarding.
It can also log the `socat` errors properly.
- Make the `Makefile` more parametric therefore the virtual disk
image can be customized better.
- Default configurations are now moved fully to the guest's side.
- Tweak the packages to be more flexible.
- Document everything.
[1] https://w1.fi/hostapd/
Diffstat (limited to 'aports/hostapd')
-rw-r--r-- | aports/hostapd/APKBUILD | 84 | ||||
-rw-r--r-- | aports/hostapd/hostapd.confd | 5 | ||||
-rw-r--r-- | aports/hostapd/hostapd.initd | 46 |
3 files changed, 135 insertions, 0 deletions
diff --git a/aports/hostapd/APKBUILD b/aports/hostapd/APKBUILD new file mode 100644 index 0000000..60265f0 --- /dev/null +++ b/aports/hostapd/APKBUILD @@ -0,0 +1,84 @@ +# Maintainer: Gabor Pali <pali.gabor@gmail.com> +pkgname=hostapd +pkgver=2.10 +pkgrel=0 +pkgdesc="daemon for wireless software access points" +url="https://w1.fi/hostapd/" +arch="all" +license="BSD-3-Clause" +makedepends="openssl1.1-compat-dev libnl3-dev linux-headers" +subpackages= +source="https://w1.fi/releases/hostapd-$pkgver.tar.gz + $pkgname.initd + $pkgname.confd + " +options="!check" #no testsuite +builddir="$srcdir"/$pkgname-$pkgver/hostapd + +# secfixes: +# 2.10-r0: +# - CVE-2022-23303 +# - CVE-2022-23304 +# 2.9-r3: +# - CVE-2021-30004 +# 2.9-r2: +# - CVE-2020-12695 +# 2.9-r1: +# - CVE-2019-16275 +# 2.8-r0: +# - CVE-2019-11555 +# - CVE-2019-9496 +# 2.6-r2: +# - CVE-2017-13077 +# - CVE-2017-13078 +# - CVE-2017-13079 +# - CVE-2017-13080 +# - CVE-2017-13081 +# - CVE-2017-13082 +# - CVE-2017-13086 +# - CVE-2017-13087 +# - CVE-2017-13088 + +prepare() { + cd "$builddir" + sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \ + hostapd.conf + + # toolchain setup + sed \ + -e '/^#CONFIG_DRIVER_NL80211=y/s/^#//' \ + -e '/^#CONFIG_RADIUS_SERVER=y/s/^#//' \ + -e '/^#CONFIG_DRIVER_WIRED=y/s/^#//' \ + -e '/^#CONFIG_DRIVER_NONE=y/s/^#//' \ + -e '/^#CONFIG_IEEE80211N=y/s/^#//' \ + -e '/^#CONFIG_IEEE80211R=y/s/^#//' \ + -e '/^#CONFIG_IEEE80211AC=y/s/^#//' \ + -e '/^#CONFIG_FULL_DYNAMIC_VLAN=y/s/^#//' \ + -e '/^#CONFIG_LIBNL32=y/s/^#//' \ + -e '/^#CONFIG_ACS=y/s/^#//' \ + -e '/^#CONFIG_WEP=y/s/^#//' \ + defconfig >> .config + echo "CC ?= ${CC:-gcc}" >> .config + echo "CFLAGS += -I/usr/include/libnl3" >> .config + echo "LIBS += -L/usr/lib" >> .config +} + +build() { + cd "$builddir" + make +} + +package() { + cd "$builddir" + + install -Dm755 hostapd "$pkgdir"/usr/sbin/hostapd \ + && install -Dm755 "$srcdir"/hostapd.initd \ + "$pkgdir"/etc/init.d/hostapd \ + && install -Dm644 "$srcdir"/hostapd.confd \ + "$pkgdir"/etc/conf.d/hostapd +} +sha512sums=" +243baa82d621f859d2507d8d5beb0ebda15a75548a62451dc9bca42717dcc8607adac49b354919a41d8257d16d07ac7268203a79750db0cfb34b51f80ff1ce8f hostapd-2.10.tar.gz +b54b7c6aa17e5cb86a9b354a516eb2dbefb544df18471339c61d82776de447011a2ac290bea1e6c8beae4b6cebefafb8174683ea42fb773e9e8fe6c679f33ba3 hostapd.initd +0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe hostapd.confd +" diff --git a/aports/hostapd/hostapd.confd b/aports/hostapd/hostapd.confd new file mode 100644 index 0000000..6038115 --- /dev/null +++ b/aports/hostapd/hostapd.confd @@ -0,0 +1,5 @@ +# Space separated list of configuration files +CONFIGS="/etc/hostapd/hostapd.conf" + +# Extra options to pass to hostapd, see hostapd(8) +OPTIONS="" diff --git a/aports/hostapd/hostapd.initd b/aports/hostapd/hostapd.initd new file mode 100644 index 0000000..7813fd1 --- /dev/null +++ b/aports/hostapd/hostapd.initd @@ -0,0 +1,46 @@ +#!/sbin/openrc-run +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-0.6.9-init.d,v 1.2 2009/05/17 10:18:18 gurligebis Exp $ + +extra_started_commands="reload" + +depend() { + need net + after firewall + use logger +} + +checkconfig() { + local file + + for file in ${CONFIGS}; do + if [ ! -r "${file}" ]; then + eerror "hostapd configuration file (${CONFIG}) not found" + return 1 + fi + done +} + +start() { + checkconfig || return 1 + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/hostapd \ + -- -B ${OPTIONS} ${CONFIGS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/hostapd + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading ${SVCNAME} configuration" + kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1 + eend $? +} |