Subject: Re: Noobie questions after install
To: None <port-hpcmips@NetBSD.org>
From: Jimi Malcolm <malcolm@cc.gatech.edu>
List: port-hpcmips
Date: 07/28/2004 03:26:19
Tim Underwood (Wed@00h13)

> 1.  How do I get my DCF-650W started up?  The card is seen as wi0 (with
> all correct info), but won't power up.  I need to have DHCP working for
> this card, for a couple of different WAPs and networks (Home and Office,
> so they'll be different ESSIDs, passwords and encryption levels).  Can I
> set up multiple profiles and select among them?

Have you tried (as root):

# ifconfig wi0 up

I don't know the best way to go between different networks, but I use
the following script to load "profiles."  Forget the authentication
stuff at the end; that's just to submit login information on a website
via lynx.

Here are examples of how to run the script:

$ sudo lan home    # use profile ~/.lan.home
$ sudo lan wired   # use profile ~/.lan.wired
$ sudo lan down    # take down network DHCP and wi0

I then have the profiles in my home directory that are sourced so as to
set the correct environment variables.  Here's an example of one for a
simple wired LAN:

---------------cut here >~/.lan.wired ------------
ENCRYPTION=no
AUTHENTICATE=no
--------------end ~/.lan.wired -------------------

Here's the profile for an encrypted network at my house
---------------cut here >~/.lan.home ---------------
AUTHENTICATE=no
ENCRYPTION=yes
SSID=hobar
KEY=0xdeadbeefef
---------------end ~/.lan.home ---------------------

------cut here >lan -------------------------------
#!/bin/sh
# lan: 
#   Configures the wireless card for the LAN. (wiconfig)
#   Gets an IP address using DHCP. (dhclient)
#   Performs the SSL authentication to access LAN. (auth)
#
# Ben Wong
# February 21, 2002
# Jimi Malcolm
# 3 Oct 2003

. /etc/rc.subr # Nice error/warn subroutines

PROGNAME=$(basename `echo $0`)

[ $1 = "-v" ] && verbose=$1 && shift || unset verbose
[ -n "$1" ] || err 2 "usage: ${PROGNAME} [ <netalias> | down ]"
netalias=$1

device=`ifconfig -lb`

if [ "$1" = "down" ]; then
    [ $verbose ] && echo "${PROGNAME}: taking down LAN device $device"
    ifconfig $device down
    [ $verbose ] && echo "${PROGNAME}: taking down dhclient"
    /etc/rc.d/dhclient stop
    exit 0
fi

# Get $SSID and $KEY from the configuration file.
if [ -r ${HOME}/.lan.${netalias} ]; then
    config="${HOME}/.lan.${netalias}"
elif [ -r ${1} ]; then
    config="$1"
else
    err 1 "cannot read ${HOME}/.lan.${netalias}"
fi
[ $verbose ] && echo "using configuration $config"
. $config

if [ ${ENCRYPTION} = "yes" ]; then
    [ $verbose ] && echo "configuring wi0 for LAN access to ${SSID}" 
    if ! wiconfig wi0 -n ${SSID} -e 1 -k ${KEY} -P 1; then
        [ $verbose ] && echo "wiconfig failed; will sleep 5 then try again." 
        sleep 5
        if ! wiconfig wi0 -n ${SSID} -e 1 -k ${KEY} -P 1; then
	        err 1 "wiconfig failed again; giving up." 
        fi
    fi
fi

[ $verbose ] && echo "${PROGNAME}: contacting the LAN dhcpd"
if ! /etc/rc.d/dhclient restart; then
  err 1 "dhclient failed"
fi

# Authenticate if necessary
if [ ${AUTHENTICATE} = "yes" ]; then
    [ $verbose ] && echo "${PROGNAME}: authenticating"
    if auth $verbose $@ ; then
        [ $verbose ] && echo "${PROGNAME}: successfully connected to LAN"
    else
        err 1 "LAN access denied"
    fi
fi
-------end here------------------------------



Let me know if you see any problems in this or ways to do things better!


> 5.  How do I cold-boot the MBPro880 and bypass the setup screens, and
> autoload the boot manager?  Putting it in /windows/startup doesn't seem
> to work.

I think this was talked about somewhere in the archives in some detail,
but basically the MobilePro series doesn't support that
/windows/startup.  WinCE is essentially hard coded to start.  Correct me
if I'm wrong; it's been over a year since I read those posts.

-Jimi