From 07603508c15a779e1c7d64324d0badce23205b2b Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Tue, 29 Jul 2008 08:00:36 +0200 Subject: [PATCH] Tried to make hostapd to run without configuration in blue0 and madwifi --- config/backup/includes/hostapd | 1 + config/hostapd/hostapd.conf | 15 +++++++++++++ config/rootfiles/packages/hostapd | 3 +++ doc/packages-list.txt | 1 + lfs/hostapd | 4 +++- lfs/v4l-dvb | 5 +++-- make.sh | 2 +- src/initscripts/init.d/hostapd | 36 +++++++++++++++++++++++++++++++ src/paks/hostapd/install.sh | 30 ++++++++++++++++++++++++++ src/paks/hostapd/uninstall.sh | 28 ++++++++++++++++++++++++ src/paks/hostapd/update.sh | 26 ++++++++++++++++++++++ 11 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 config/backup/includes/hostapd create mode 100644 config/hostapd/hostapd.conf create mode 100644 src/initscripts/init.d/hostapd create mode 100644 src/paks/hostapd/install.sh create mode 100644 src/paks/hostapd/uninstall.sh create mode 100644 src/paks/hostapd/update.sh diff --git a/config/backup/includes/hostapd b/config/backup/includes/hostapd new file mode 100644 index 0000000000..f61980010e --- /dev/null +++ b/config/backup/includes/hostapd @@ -0,0 +1 @@ +/etc/hostapd.conf diff --git a/config/hostapd/hostapd.conf b/config/hostapd/hostapd.conf new file mode 100644 index 0000000000..642b682a39 --- /dev/null +++ b/config/hostapd/hostapd.conf @@ -0,0 +1,15 @@ +interface=blue0 +driver=madwifi +auth_algs=3 +wpa=1 +wpa_passphrase=IPFire +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP +debug=0 +logger_syslog=-1 +logger_syslog_level=2 +dump_file=/tmp/hostapd.dump +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 +ssid=IPFire +macaddr_acl=0 diff --git a/config/rootfiles/packages/hostapd b/config/rootfiles/packages/hostapd index 269ec23a94..f0acfa89db 100644 --- a/config/rootfiles/packages/hostapd +++ b/config/rootfiles/packages/hostapd @@ -1,2 +1,5 @@ +etc/hostapd.conf +etc/init.d/hostapd usr/bin/hostapd usr/bin/hostapd_cli +var/ipfire/backup/addons/includes/hostapd diff --git a/doc/packages-list.txt b/doc/packages-list.txt index f5a3079f44..8a9066fb8f 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -287,6 +287,7 @@ * usbutils-0.72 * util-linux-2.12r * v4l-dvb-9ff62c80bf4c +* v4l-dvb-e9a442d3b53a * vdr-1.6.0 * vim-7.0 * vlan.1.9 diff --git a/lfs/hostapd b/lfs/hostapd index b4639b9aab..e58e4b978e 100644 --- a/lfs/hostapd +++ b/lfs/hostapd @@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = hostapd -PAK_VER = 1 +PAK_VER = 2 DEPS = "" @@ -81,5 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && cp $(DIR_SRC)/config/hostapd/config ./.config cd $(DIR_APP) && sed -e "s@/usr/local@/usr@g" -i Makefile cd $(DIR_APP) && make && make install + cp -vrf $(DIR_SRC)/config/hostapd/hostapd.conf /etc/hostapd.conf + install -v -m 644 $(DIR_SRC)/config/backup/includes/hostapd /var/ipfire/backup/addons/includes/hostapd @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/v4l-dvb b/lfs/v4l-dvb index 5dd5ef4cc0..f189e2eb70 100644 --- a/lfs/v4l-dvb +++ b/lfs/v4l-dvb @@ -24,12 +24,13 @@ include Config -VER = 9ff62c80bf4c +VER = e9a442d3b53a THISAPP = v4l-dvb-$(VER) DL_FILE = $(THISAPP).tar.bz2 DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) +PAK_VER = 2 ifeq "$(SMP)" "1" TARGET = $(DIR_INFO)/$(THISAPP)-smp else @@ -45,7 +46,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = eeb6a77c1ef26bc05a5d4cdba5a5167b +$(DL_FILE)_MD5 = e4d9fccd3e3c242d1dce59bc5ecd2c51 install : $(TARGET) diff --git a/make.sh b/make.sh index 3302773e5e..df382ce8d4 100755 --- a/make.sh +++ b/make.sh @@ -859,7 +859,7 @@ gettoolchain) cd $BASEDIR/cache/toolchains wget $URL_TOOLCHAIN/$PACKAGE.tar.gz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null if [ $? -ne 0 ]; then - echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE + echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE else if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE diff --git a/src/initscripts/init.d/hostapd b/src/initscripts/init.d/hostapd new file mode 100644 index 0000000000..87b08bb8ad --- /dev/null +++ b/src/initscripts/init.d/hostapd @@ -0,0 +1,36 @@ +#!/bin/sh +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + /usr/local/bin/wlanconfig ath0 destroy + /usr/local/bin/wlanconfig blue0 create wlandev wifi0 wlanmode ap + /usr/sbin/iwconfig blue0 channel 05 + /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf & + evaluate_retval + ;; + + stop) + # Just make shure when going down the first time blue0 nw values are ignored + sed -i -e 's/^ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/#ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/' /etc/udev/rules.d/30-persistent-network.rules + /usr/local/bin/wlanconfig blue0 destroy + killproc /usr/bin/hostapd + evaluate_retval + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/bin/hostapd + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac diff --git a/src/paks/hostapd/install.sh b/src/paks/hostapd/install.sh new file mode 100644 index 0000000000..9a9aef1df6 --- /dev/null +++ b/src/paks/hostapd/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +ln -s ../init.d/hostap /etc/rc.d/rc3.d/S18hostap +ln -s ../init.d/hostap /etc/rc.d/rc0.d/K81hostap +ln -s ../init.d/hostap /etc/rc.d/rc6.d/K81hostap +start_service --background ${NAME} diff --git a/src/paks/hostapd/uninstall.sh b/src/paks/hostapd/uninstall.sh new file mode 100644 index 0000000000..f2e528e7ea --- /dev/null +++ b/src/paks/hostapd/uninstall.sh @@ -0,0 +1,28 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} +make_backup ${NAME} +rm -rf /etc/rc.d/rc*.d/*hostap +remove_files diff --git a/src/paks/hostapd/update.sh b/src/paks/hostapd/update.sh new file mode 100644 index 0000000000..89c40d0d7c --- /dev/null +++ b/src/paks/hostapd/update.sh @@ -0,0 +1,26 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +./uninstall.sh +./install.sh -- 2.39.2