Author Topic: Enabling hostapd at runtime (FreeBSD 6.0)  (Read 3202 times)

0 Members and 1 Guest are viewing this topic.

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Enabling hostapd at runtime (FreeBSD 6.0)
« on: August 17, 2006, 10:01:46 pm »
I have found no way other than to write my own damn script and boot it. Suggestions?
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #1 on: August 17, 2006, 10:10:14 pm »
I have found no way other than to write my own damn script and boot it. Suggestions?

/etc/rc.d/hostapd onestart

or add to rc.conf
hostapd_enable="YES"

You will need to make a /etc/hostapd.conf
An adorable giant isopod!

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #2 on: August 17, 2006, 10:50:59 pm »
Quote
newby@zombie:~$ ls /etc/rc.d/hostapd
ls: /etc/rc.d/hostapd: No such file or directory
newby@zombie:~$

It does not exist. I am running FreeBSD 6.0.

hostapd_enable="YES" does not work either. :/

Quote
newby@zombie:~$ ls -l /etc/hostapd.conf
-rw-r--r--  1 root  wheel  299 Aug 17 18:17 /etc/hostapd.conf
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #3 on: August 17, 2006, 11:40:01 pm »
Quote
newby@zombie:~$ ls /etc/rc.d/hostapd
ls: /etc/rc.d/hostapd: No such file or directory
newby@zombie:~$

It does not exist. I am running FreeBSD 6.0.

hostapd_enable="YES" does not work either. :/

Quote
newby@zombie:~$ ls -l /etc/hostapd.conf
-rw-r--r--  1 root  wheel  299 Aug 17 18:17 /etc/hostapd.conf

It should exist.  Did you update the system sources for 6.0 and makeworld and then mergemaster?
An adorable giant isopod!

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #4 on: August 18, 2006, 01:18:53 am »
It was a fresh install from the 6.0 CD ISOs.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #5 on: August 18, 2006, 08:47:52 am »
It was a fresh install from the 6.0 CD ISOs.

give me the output from 'uname -a'
You should always build world on new installs.
Be sure you cvsup the new system sources.
build world builds all the system utilities (specified by /etc/make.con).
mergemaster merges new scripts and config files with existing one.
BTW, Here is the hostapd rc file:
Quote
%cat /etc/rc.d/hostapd
#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/hostapd,v 1.1.2.1 2006/02/12 22:13:15 flz Exp $
#

# PROVIDE: hostapd
# REQUIRE: mountcritremote
# KEYWORD: nojail shutdown

. /etc/rc.subr

name="hostapd"
command="/usr/sbin/${name}"
rcvar=`set_rcvar`

conf_file="/etc/${name}.conf"

command_args="-B ${conf_file}"
required_files="${conf_file}"

load_rc_config ${name}
run_rc_command "$1"

Copy and paste into specified file and then 'hostapd_enable="YES"' will work.
So will /etc/rc.d/hostapd onestart
An adorable giant isopod!

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #6 on: August 18, 2006, 11:47:02 am »
Quote
newby@zombie:~$ uname -a
FreeBSD zombie.x86labs.org 6.0-RELEASE-p6 FreeBSD 6.0-RELEASE-p6 #1: Sat Apr 22 09:57:26 PDT 2006     root@zombie.x86labs.org:/usr/obj/usr/src/sys/ZOMBIE  i386

I compiled my own kernel. That's about it. :P

By the way, thanks nslay. I appreciate the help. This frustrated me to no end. :(
« Last Edit: August 18, 2006, 02:36:37 pm by Newby »
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #7 on: August 18, 2006, 07:49:05 pm »
Quote
newby@zombie:~$ uname -a
FreeBSD zombie.x86labs.org 6.0-RELEASE-p6 FreeBSD 6.0-RELEASE-p6 #1: Sat Apr 22 09:57:26 PDT 2006     root@zombie.x86labs.org:/usr/obj/usr/src/sys/ZOMBIE  i386

I compiled my own kernel. That's about it. :P

By the way, thanks nslay. I appreciate the help. This frustrated me to no end. :(

Let's build an /etc/make.conf
Here is look at mine:
Quote
CPUTYPE=pentium-m
KERNCONF=LIGHTBULB
# KERNCONF=GENERIC

MODULES_OVERRIDE=linux wlan_tkip wlan_ccmp wlan_wep sound acpi iwi syscons if_tap

NO_ATM=1
NO_I4B=1
NO_IPFILTER=1
NO_LPR=1
NO_MAILWRAPPER=1

PPP_NO_NAT=1
PPP_NO_NETGRAPH=1
PPP_NO_RADIUS=1

SUP_UPDATE=1
SUP=/usr/local/bin/cvsup
SUPFLAGS=-g -L 2
SUPFILE=/root/cvsup/standard-supfile
PORTSSUPFILE=/root/cvsup/ports-supfile
DOCSUPFILE=/root/cvsup/doc-supfile

DOC_LANG=en_US.ISO8859-1

# Ports specific
WITHOUT_MOZILLA=1
CUPS_OVERWRITE_BASE=1
WITH_CUPS=1
#WITHOUT_WEB=1
WITH_KQEMU=1

First add your CPUTYPE, it can be found in the example make.conf /usr/share/examples/etc/make.conf.
Quote
# The CPUTYPE variable controls which processor should be targeted for
# generated code.  This controls processor-specific optimizations in
# certain code (currently only OpenSSL) as well as modifying the value
# of CFLAGS to contain the appropriate optimization directive to gcc.
# The automatic setting of CFLAGS may be overridden using the
# NO_CPU_CFLAGS variable below.
# Currently the following CPU types are recognized:
#   Intel x86 architecture:
#       (AMD CPUs)      opteron athlon64 athlon-mp athlon-xp athlon-4
#                       athlon-tbird athlon k8 k6-3 k6-2 k6 k5
#       (Intel CPUs)    nocona pentium4[m] prescott pentium3[m] pentium-m
#                       pentium2 pentiumpro pentium-mmx pentium i486 i386
#   Alpha/AXP architecture: ev67 ev6 pca56 ev56 ev5 ev45 ev4
#   AMD64 architecture: opteron, athlon64, nocona
#   Intel ia64 architecture: itanium2, itanium
#
# (?= allows to buildworld for a different CPUTYPE.)
#
#CPUTYPE?=pentium3

For KERNCONF, put your kernel config file name...your kernel config should be in /usr/src/sys/i386/conf.
MODULES_OVERRIDE specifies which specific kernel modules should be built.  Because most of my drivers are compiled into the kernel, mine is a very a short list.  The list of modules can be found by 'ls /usr/src/sys/modules/'.  If you forget to build a module, you can always go to source directory and build it.
e.g. if I want to build an iwi module, I would do:
cd /sys/modules/iwi && make deps && make && make install
or something like that... /sys is a symlink to /usr/src/sys
To note...using MODULES_OVERRIDE or NO_MODULES can reduce the kernel compile time significantly (my kernel compiles will take a couple minutes).

The NO_* and PPP_NO_* lines influence buildworld ... it will not build the specified support, libraries or utilities.  The list can be got in 'man make.conf'.

Quote
SUP_UPDATE=1
SUP=/usr/local/bin/cvsup
SUPFLAGS=-g -L 2
SUPFILE=/root/cvsup/standard-supfile
PORTSSUPFILE=/root/cvsup/ports-supfile
DOCSUPFILE=/root/cvsup/doc-supfile

DOC_LANG=en_US.ISO8859-1

You can copy this line by line.  Change the locations of your supfiles to where you put standard-supfile, ports-supfile and doc-supfile.
By adding these to your make.conf, you can update the system with 'make update'
e.g.
update ports:
cd /usr/ports && make update
update everything:
cd /usr/src && make update
update doc:
cd /usr/doc && make update

Not only that, but if you properly setup your make.conf, you will also be able to build a kernel like this:
cd /usr/src && make kernel

To build world, do this:
cd /usr/src && make update && make buildworld && make kernel && reboot
After you reboot, do this:
mergemaster -p && make installworld && mergemaster && reboot
when mergemaster -p executes, keep the temporary directory.

When you run mergemaster, it will ask you if you want to merge or replace existing different scripts, confs and so forth.
Tip:
If its a script it prompts for, install the new one
It its a conf you've never touched, install the new one
If its motd, install the new one (not that it matters)

If you made a mistake you can always run mergemaster again.
If you have nothing left to merge, delete the tmp diretcory.
An adorable giant isopod!

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Enabling hostapd at runtime (FreeBSD 6.0)
« Reply #8 on: August 18, 2006, 09:39:06 pm »
When I install FreeBSD 6.1 onto my router (fresh install, this install is hectic) I'll do that. I should get around to that tomorrow or hopefully Sunday.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT.