testing: Build hostapd from sources
authorTobias Brunner <tobias@strongswan.org>
Wed, 15 Jun 2016 16:19:23 +0000 (18:19 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 16 Jun 2016 12:36:15 +0000 (14:36 +0200)
There is a bug (fix at [1]) in hostapd 2.1-2.3 that let it crash when used
with the wired driver.  The package in jessie (and sid) is affected, so we
build it from sources (same, older, version as wpa_supplicant).

[1] http://w1.fi/cgit/hostap/commit/?id=e9b783d58c23a7bb50b2f25bce7157f1f3

testing/scripts/build-baseimage
testing/scripts/recipes/004_hostapd.mk [new file with mode: 0644]
testing/scripts/recipes/patches/hostapd-config [new file with mode: 0644]

index 2d923d5..1264bd7 100755 (executable)
@@ -18,7 +18,7 @@ INC=$INC,libxml2-dev,libtspi-dev,libsqlite3-dev,openssh-server,tcpdump,psmisc
 INC=$INC,openssl,vim,sqlite3,conntrack,gdb,cmake,libltdl-dev,liblog4cxx10-dev
 INC=$INC,libboost-thread-dev,libboost-system-dev,git-core,iperf,htop,screen
 INC=$INC,gnat,gprbuild,acpid,acpi-support-base,libldns-dev,libunbound-dev
-INC=$INC,dnsutils,hostapd,libsoup2.4-dev,ca-certificates,unzip
+INC=$INC,dnsutils,libsoup2.4-dev,ca-certificates,unzip
 INC=$INC,python,python-setuptools,python-dev,python-pip,apt-transport-https
 INC=$INC,libjson0-dev,libxslt1-dev,libapache2-mod-wsgi,iptables-dev
 case "$BASEIMGSUITE" in
diff --git a/testing/scripts/recipes/004_hostapd.mk b/testing/scripts/recipes/004_hostapd.mk
new file mode 100644 (file)
index 0000000..0acd428
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/make
+
+PV  = 2.0
+PKG = hostapd-$(PV)
+TAR = $(PKG).tar.gz
+SRC = http://w1.fi/releases/$(TAR)
+
+NUM_CPUS := $(shell getconf _NPROCESSORS_ONLN)
+
+CONFIG_OPTS =
+
+PATCHES = \
+       hostapd-config
+
+SUBDIR = hostapd
+
+all: install
+
+$(TAR):
+       wget $(SRC)
+
+.$(PKG)-unpacked: $(TAR)
+       tar xfz $(TAR)
+       @touch $@
+
+.$(PKG)-patches-applied: .$(PKG)-unpacked
+       cd $(PKG) && cat $(addprefix ../patches/, $(PATCHES)) | patch -p1
+       @touch $@
+
+.$(PKG)-configured: .$(PKG)-patches-applied
+       cp $(PKG)/$(SUBDIR)/defconfig $(PKG)/$(SUBDIR)/.config
+       @touch $@
+
+.$(PKG)-built: .$(PKG)-configured
+       cd $(PKG)/$(SUBDIR) && make -j $(NUM_CPUS)
+       @touch $@
+
+install: .$(PKG)-built
+       cd $(PKG)/$(SUBDIR) && make install
diff --git a/testing/scripts/recipes/patches/hostapd-config b/testing/scripts/recipes/patches/hostapd-config
new file mode 100644 (file)
index 0000000..b26d278
--- /dev/null
@@ -0,0 +1,38 @@
+diff -u -ur hostapd-2.0.orig/hostapd/defconfig hostapd-2.0/hostapd/defconfig
+--- hostapd-2.0.orig/hostapd/defconfig 2013-01-12 16:42:53.000000000 +0100
++++ hostapd-2.0/hostapd/defconfig      2016-06-15 17:32:57.000000000 +0200
+@@ -13,14 +13,14 @@
+ CONFIG_DRIVER_HOSTAP=y
+ # Driver interface for wired authenticator
+-#CONFIG_DRIVER_WIRED=y
++CONFIG_DRIVER_WIRED=y
+ # Driver interface for madwifi driver
+ #CONFIG_DRIVER_MADWIFI=y
+ #CFLAGS += -I../../madwifi # change to the madwifi source directory
+ # Driver interface for drivers using the nl80211 kernel interface
+-CONFIG_DRIVER_NL80211=y
++#CONFIG_DRIVER_NL80211=y
+ # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+ #CONFIG_DRIVER_BSD=y
+@@ -30,7 +30,7 @@
+ #LIBS_c += -L/usr/local/lib
+ # Driver interface for no driver (e.g., RADIUS server only)
+-#CONFIG_DRIVER_NONE=y
++CONFIG_DRIVER_NONE=y
+ # IEEE 802.11F/IAPP
+ CONFIG_IAPP=y
+@@ -152,7 +152,7 @@
+ # Add support for writing debug log to a file: -f /tmp/hostapd.log
+ # Disabled by default.
+-#CONFIG_DEBUG_FILE=y
++CONFIG_DEBUG_FILE=y
+ # Remove support for RADIUS accounting
+ #CONFIG_NO_ACCOUNTING=y
\ No newline at end of file